randydev commited on
Commit
52ff43d
·
verified ·
1 Parent(s): 48eb3a3

Update models.js

Browse files
Files changed (1) hide show
  1. models.js +2 -2
models.js CHANGED
@@ -2,12 +2,12 @@ import mongoose from "mongoose";
2
 
3
  const apiKeySchema = new mongoose.Schema({
4
  key: { type: String, required: true, unique: true },
5
- owner: { type: Number, required: true, unique: true },
6
  is_banned: { type: Boolean, default: false },
7
  email: { type: String },
8
  createdAt: { type: Date, default: Date.now },
9
  type: { type: String, enum: ["free", "premium"], default: "free" },
10
- expiresAt: { type: Date, required: true },
11
  is_expired: { type: Boolean, default: false }
12
  });
13
 
 
2
 
3
  const apiKeySchema = new mongoose.Schema({
4
  key: { type: String, required: true, unique: true },
5
+ owner: { type: Number, required: true },
6
  is_banned: { type: Boolean, default: false },
7
  email: { type: String },
8
  createdAt: { type: Date, default: Date.now },
9
  type: { type: String, enum: ["free", "premium"], default: "free" },
10
+ expiresAt: { type: Date, required: true, index: { expires: 0 } },
11
  is_expired: { type: Boolean, default: false }
12
  });
13