feat: add Timestamps to User model

This commit is contained in:
wancat committed 2023-10-14 15:42:39 +08:00
1 parent 916b78240c
commit d3dd12a547
1 file changed
+11 -3
+11 -3
View File
@@ -1,6 +1,9 @@
import { model } from 'mongoose' import { model, Schema } from 'mongoose'
const User = model('User', { const User = model(
'User',
new Schema(
{
username: { username: {
type: String, type: String,
unique: true, unique: true,
@@ -20,6 +23,11 @@ const User = model('User', {
id: String, id: String,
displayName: String, displayName: String,
}, },
}) },
{
timestamps: true,
}
)
)
export default User export default User