File tree 5 files changed +10
-8
lines changed
5 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ Table User {
53
53
id Int [pk, increment]
54
54
name String [not null]
55
55
profile Profile
56
- role Role [not null, default: 'USER', note: 'User Role']
56
+ role Role [not null, default: 'USER', note: 'User\\'s Role']
57
57
}
58
58
59
59
Table Profile {
@@ -62,7 +62,7 @@ Table Profile {
62
62
user User [not null]
63
63
userId Int [not null]
64
64
65
- Note: 'User Profile model'
65
+ Note: 'User\\'s Profile model'
66
66
}
67
67
68
68
Enum Role {
Original file line number Diff line number Diff line change @@ -65,9 +65,9 @@ export const datamodelDbmlComments = /* Prisma */ `
65
65
id Int @id @default(autoincrement())
66
66
name String
67
67
profile Profile?
68
- role Role @default(USER) /// User Role
68
+ role Role @default(USER) /// User's Role
69
69
}
70
- /// User Profile model
70
+ /// User's Profile model
71
71
model Profile {
72
72
id Int @id @default(autoincrement())
73
73
name String
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Table User {
10
10
name String
11
11
posts Post [not null]
12
12
profile Profile
13
- role Role [not null, default: 'USER', note: 'user role']
13
+ role Role [not null, default: 'USER', note: 'user\'s role']
14
14
}
15
15
16
16
Table Profile {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ model User {
22
22
name String ?
23
23
posts Post []
24
24
profile Profile ?
25
- /// user role
25
+ /// user's role
26
26
role Role @default (USER )
27
27
}
28
28
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ const generateTableCompositeUniqueIndex = (
42
42
} ;
43
43
44
44
const generateTableDocumentation = ( model : DMMF . Model ) : string => {
45
- const doc = model . documentation ;
45
+ const doc = model . documentation ?. replace ( "'" , "\\'" ) ;
46
46
return doc ? `\n\n Note: '${ doc } '` : '' ;
47
47
} ;
48
48
@@ -86,7 +86,9 @@ const generateColumnDefinition = (field: DMMF.Field): string => {
86
86
}
87
87
88
88
if ( field . documentation ) {
89
- columnDefinition . push ( `${ DBMLKeywords . Note } : '${ field . documentation } '` ) ;
89
+ columnDefinition . push (
90
+ `${ DBMLKeywords . Note } : '${ field . documentation . replace ( "'" , "\\'" ) } '`
91
+ ) ;
90
92
}
91
93
92
94
if ( columnDefinition . length ) {
You can’t perform that action at this time.
0 commit comments