harnill commited on
Commit
ded43ce
·
verified ·
1 Parent(s): 187c403

Create models/Project.ts

Browse files
Files changed (1) hide show
  1. models/Project.ts +32 -0
models/Project.ts ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import mongoose from "mongoose";
2
+
3
+ const ProjectSchema = new mongoose.Schema({
4
+ space_id: {
5
+ type: String,
6
+ required: true,
7
+ },
8
+ user_id: {
9
+ type: String,
10
+ required: true,
11
+ },
12
+ title: {
13
+ type: String,
14
+ required: false,
15
+ default: null,
16
+ },
17
+ prompts: {
18
+ type: [String],
19
+ default: [],
20
+ },
21
+ _createdAt: {
22
+ type: Date,
23
+ default: Date.now,
24
+ },
25
+ _updatedAt: {
26
+ type: Date,
27
+ default: Date.now,
28
+ },
29
+ });
30
+
31
+ export default mongoose.models.Project ||
32
+ mongoose.model("Project", ProjectSchema);