fistcommit
This commit is contained in:
29
models/admin_model.ts
Normal file
29
models/admin_model.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
//
|
||||
const adminSchema = new mongoose.Schema({
|
||||
username: {
|
||||
type: String,
|
||||
required: true,
|
||||
unique: true
|
||||
},
|
||||
password: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
required: true,
|
||||
unique: true
|
||||
},
|
||||
createdAt: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// this is the model for the admin
|
||||
const AdminModel = mongoose.model('Admin', adminSchema);
|
||||
|
||||
export default AdminModel;
|
Reference in New Issue
Block a user