mirror of
https://github.com/franjsco/umbrello-bot
synced 2025-02-16 11:41:16 +01:00
Add user model
This commit is contained in:
parent
61467f2f8a
commit
06a9e3dec5
29
src/db/user.model.js
Normal file
29
src/db/user.model.js
Normal file
@ -0,0 +1,29 @@
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
const user = {
|
||||
id: {
|
||||
type: Number,
|
||||
required: true,
|
||||
trim: true,
|
||||
},
|
||||
city: {
|
||||
id: {
|
||||
type: Number,
|
||||
required: false,
|
||||
trim: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: false,
|
||||
trim: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const userSchema = mongoose.Schema(user, {
|
||||
collection: 'umbrello_users',
|
||||
});
|
||||
|
||||
const User = mongoose.model('user', userSchema);
|
||||
|
||||
export default User;
|
Loading…
x
Reference in New Issue
Block a user