aboutsummaryrefslogtreecommitdiff
path: root/src/model/User.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/User.ts')
-rw-r--r--src/model/User.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/model/User.ts b/src/model/User.ts
new file mode 100644
index 0000000..7b845cf
--- /dev/null
+++ b/src/model/User.ts
@@ -0,0 +1,18 @@
+import { Schema, model, models } from "mongoose";
+
+const UserSchema = new Schema({
+ name: { type: String, required: true },
+ email: { type: String, required: true, unique: true },
+ password: { type: String, required: true },
+ profileImage: {
+ url: { type: String },
+ key: { type: String },
+ uploadedAt: { type: Date }
+ }
+}, {
+ timestamps: true
+});
+
+const User = models.User || model("User", UserSchema);
+
+export default User; \ No newline at end of file