Created
July 20, 2022 15:00
-
-
Save igor-ribeiro/1cd7c3ac732e0d399afd72d849898f38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": { | |
"prefix": ["id"], | |
"description": "Prisma id column", | |
"body": ["id String @id @default(${1:cuid()})"] | |
}, | |
"dates": { | |
"prefix": ["dates"], | |
"description": "Prisma createdAt and updatedAt", | |
"body": [ | |
"createdAt DateTime @default(now())", | |
"updatedAt DateTime @updatedAt", | |
"" | |
] | |
}, | |
"model": { | |
"prefix": ["model"], | |
"description": "Prisma model", | |
"body": [ | |
"model $1 {", | |
" id String @id @default(${2:cuid()})", | |
" $3", | |
" ", | |
" createdAt DateTime @default(now())", | |
" updatedAt DateTime @updatedAt", | |
"}" | |
] | |
}, | |
"relation": { | |
"prefix": ["relation"], | |
"description": "Prisma relation", | |
"body": [ | |
"$1 ${1/(.*)/${1:/capitalize}/} @relation(fields: [$1Id], references: [id], onDelete: Cascade, onUpdate: Cascade)", | |
"$1Id String" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment