summaryrefslogtreecommitdiffstats
path: root/backend/database
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-03-28 15:22:34 -0400
committerWes Bos <wesbos@gmail.com>2018-03-28 15:22:34 -0400
commit65c524251d49ade9d44a62337f3c1c1fed6eedd0 (patch)
treed504ba9cea8d89bbde4b2e809fddb048bd660548 /backend/database
parenta1fd7eb33bb08610aaf381a64b7f963cd98bfdaa (diff)
Permissions
Diffstat (limited to 'backend/database')
-rw-r--r--backend/database/datamodel.graphql21
-rw-r--r--backend/database/prisma.yml3
2 files changed, 12 insertions, 12 deletions
diff --git a/backend/database/datamodel.graphql b/backend/database/datamodel.graphql
index f31a089..43ae403 100644
--- a/backend/database/datamodel.graphql
+++ b/backend/database/datamodel.graphql
@@ -1,11 +1,11 @@
-type Post {
- id: ID! @unique
- createdAt: DateTime!
- updatedAt: DateTime!
- isPublished: Boolean! @default(value: "false")
- title: String!
- text: String!
- author: User!
+enum Permission {
+ ADMIN
+ USER
+ ITEMCREATE
+ ITEMUPDATE
+ ITEMDELETE
+ PERMISSIONUPDATE
+ NUKE
}
type User {
@@ -13,15 +13,13 @@ type User {
email: String! @unique
password: String!
name: String!
- posts: [Post!]!
orders: [Order!]!
- website: String
- age: Int
resetToken: String
resetTokenExpiry: String
cart: [CartItem!]!
createdAt: DateTime!
updatedAt: DateTime!
+ permissions: [Permission!]!
}
type CartItem {
@@ -42,6 +40,7 @@ type Item {
price: Int!
createdAt: DateTime!
updatedAt: DateTime!
+ user: User! # Relationship to a user
}
type OrderItem {
diff --git a/backend/database/prisma.yml b/backend/database/prisma.yml
index b01378b..b52f72b 100644
--- a/backend/database/prisma.yml
+++ b/backend/database/prisma.yml
@@ -16,5 +16,6 @@ datamodel: datamodel.graphql
# import: seed.graphql
# cluster: ${env:PRISMA_CLUSTER}
-cluster: local
+# cluster: local
+# cluster: wesbos/prisma-us1 \ No newline at end of file