Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions schemas/datasource.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
{
"const": "elasticgraph",
"description": "Ealasticgraph as datasource"
},
{
"type": "string",
"description": "Custom datasource type."
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions schemas/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"required": ["application/json"]
}
},
"required": ["content"]
"required": []
},
"authn": {
"type": "boolean",
Expand Down Expand Up @@ -213,10 +213,10 @@
"required": ["application/json"]
}
},
"required": ["content"]
"required": []
}
},
"required": ["200"]
"required": []
}
}
}
37 changes: 37 additions & 0 deletions snippets/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,42 @@
"\t\t\tmessage: <% inputs.body.message %>"

]
},
"prisma schema sample": {
"prefix": ["prisma schema sample"],
"body": [
"datasource db {",
"\tprovider = 'mongodb'",
"\turl = env('DATABASE_URL')",
"}",
"generator client {",
"\tprovider = 'prisma-client-js'",
"}",
"",
"model Post {",
"\tid String @id @default(auto()) @map(_id') @db.ObjectId",
"\tslug String @unique",
"\ttitle String",
"\tbody String",
"\tauthor User @relation(fields: [authorId], references: [id])",
"\tauthorId String @db.ObjectId",
"comments Comment[]",
"}",
"",
"model User",
"\tid String @id @default(auto()) @map('_id') @db.ObjectId",
"\temail String @unique",
"\tname String?",
"\taddress Address?",
"\tposts Post[]",
"}",
"",
"model Comment {",
"\tid String @id @default(auto()) @map('_id') @db.ObjectId",
"\tcomment String",
"\tpost Post @relation(fields: [postId], references: [id])",
"\tpostId String @db.ObjectId",
"}"
]
}
}