diff options
| author | Johannes Schickling <schickling.j@gmail.com> | 2018-05-21 16:36:32 -0700 |
|---|---|---|
| committer | Johannes Schickling <schickling.j@gmail.com> | 2018-05-21 16:36:32 -0700 |
| commit | 603f1a0e9df2f88184cc03ce2e7177547daa0674 (patch) | |
| tree | f6a934b28cd9c8ac7d80fffea026938787c5407d /backend/prisma | |
| parent | 51f593384f1325b78a263d0d870d162236ed28d2 (diff) | |
use prisma deploy hooks
Diffstat (limited to 'backend/prisma')
| -rw-r--r-- | backend/prisma/datamodel.graphql | 67 | ||||
| -rw-r--r-- | backend/prisma/prisma.yml | 6 |
2 files changed, 73 insertions, 0 deletions
diff --git a/backend/prisma/datamodel.graphql b/backend/prisma/datamodel.graphql new file mode 100644 index 0000000..9465524 --- /dev/null +++ b/backend/prisma/datamodel.graphql @@ -0,0 +1,67 @@ +enum Permission { + ADMIN + USER + ITEMCREATE + ITEMUPDATE + ITEMDELETE + PERMISSIONUPDATE +} + +type User { + id: ID! @unique + email: String! @unique + password: String! + name: String! + orders: [Order!]! + resetToken: String + resetTokenExpiry: String + cart: [CartItem!]! + createdAt: DateTime! + updatedAt: DateTime! + permissions: [Permission!]! +} + +type CartItem { + id: ID! @unique + quantity: Int! @default(value: 1) + item: Item # Relationship to an Item + user: User! # Relationship to a user + createdAt: DateTime! + updatedAt: DateTime! +} + +type Item { + id: ID! @unique + title: String! + description: String! + image: String + largeImage: String + price: Int! + createdAt: DateTime! + updatedAt: DateTime! + user: User! # Relationship to a user +} + +type OrderItem { + id: ID! @unique + title: String! + description: String! + image: String + largeImage: String + price: Int! + createdAt: DateTime! + updatedAt: DateTime! + quantity: Int! @default(value: 1) + item: Item! # Relationship to an Item + user: User! # Relationship to a user +} + +type Order { + id: ID! @unique + items: [OrderItem!]! + total: Int! + user: User! + createdAt: DateTime! + updatedAt: DateTime! + charge: String! +}
\ No newline at end of file diff --git a/backend/prisma/prisma.yml b/backend/prisma/prisma.yml new file mode 100644 index 0000000..2940bab --- /dev/null +++ b/backend/prisma/prisma.yml @@ -0,0 +1,6 @@ +datamodel: datamodel.graphql +endpoint: ${env:PRISMA_ENDPOINT} +secret: ${env:PRISMA_SECRET} +hooks: + post-deploy: + - graphql get-schema -p prisma |
