File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ model User {
1818 accounts Account []
1919 formResponses FormResponse []
2020 sessions Session []
21+ templates Template []
2122
2223 @@map (" user " )
2324}
@@ -99,6 +100,40 @@ model FormFields {
99100 @@map (" form_fields " )
100101}
101102
103+ model Template {
104+ id String @id @default (uuid () )
105+ title String
106+ description String ?
107+ ownerId String ?
108+ isBuiltIn Boolean @default (false )
109+ sourceTemplateId String ?
110+ createdAt DateTime @default (now () )
111+ updatedAt DateTime @updatedAt
112+ owner User ? @relation (fields : [ownerId ] , references : [id ] , onDelete : Cascade )
113+ templateFields TemplateField []
114+
115+ @@map (" template " )
116+ }
117+
118+ model TemplateField {
119+ id String @id @default (uuid () )
120+ fieldName String
121+ label String ?
122+ fieldValueType String
123+ fieldType String
124+ validation Json ?
125+ options Json ?
126+ prevFieldId String ?
127+ createdAt DateTime @default (now () )
128+ updatedAt DateTime @updatedAt
129+ templateId String
130+ template Template @relation (fields : [templateId ] , references : [id ] , onDelete : Cascade )
131+
132+ @@index ([templateId ] )
133+ @@index ([templateId , prevFieldId ] )
134+ @@map (" template_fields " )
135+ }
136+
102137model FormResponse {
103138 id String @id @default (uuid () )
104139 formId String
You can’t perform that action at this time.
0 commit comments