Update models.js
Browse files
models.js
CHANGED
@@ -1,15 +1,14 @@
|
|
1 |
import mongoose from "mongoose";
|
2 |
|
3 |
const apiKeySchema = new mongoose.Schema({
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
});
|
13 |
|
14 |
|
15 |
const jobSchema = new mongoose.Schema({
|
|
|
1 |
import mongoose from "mongoose";
|
2 |
|
3 |
const apiKeySchema = new mongoose.Schema({
|
4 |
+
key: { type: String, unique: true, required: true },
|
5 |
+
owner: { type: Number, required: true },
|
6 |
+
createdAt: { type: Date, default: Date.now },
|
7 |
+
expiresAt: { type: Date, required: true, index: { expires: "30d" } },
|
8 |
+
type: { type: String, default: "premium" },
|
9 |
+
is_banned: { type: Boolean, default: false },
|
10 |
+
email: { type: String, default: null }
|
11 |
+
}, { collection: "ApiKey" });
|
|
|
12 |
|
13 |
|
14 |
const jobSchema = new mongoose.Schema({
|