summaryrefslogtreecommitdiffstats
path: root/backend/database
diff options
context:
space:
mode:
Diffstat (limited to 'backend/database')
-rw-r--r--backend/database/datamodel.graphql13
-rw-r--r--backend/database/prisma.yml3
2 files changed, 14 insertions, 2 deletions
diff --git a/backend/database/datamodel.graphql b/backend/database/datamodel.graphql
index 4620206..ed70892 100644
--- a/backend/database/datamodel.graphql
+++ b/backend/database/datamodel.graphql
@@ -14,6 +14,7 @@ type User {
password: String!
name: String!
posts: [Post!]!
+ orders: [Order!]!
website: String
age: Int
resetToken: String
@@ -24,12 +25,22 @@ type User {
type CartItem {
id: ID! @unique
quantity: Int! @default(value: 1)
- item: Item!
+ item: Item! # Relationship to an Item
+ user: User! # Relationship to a user
}
type Item {
id: ID! @unique
title: String!
description: String!
+ image: String
price: Int!
}
+
+type Order {
+ id: ID! @unique
+ items: [Item!]!
+ total: Int!
+ user: User!
+ charge: String!
+} \ No newline at end of file
diff --git a/backend/database/prisma.yml b/backend/database/prisma.yml
index ce652ef..b01378b 100644
--- a/backend/database/prisma.yml
+++ b/backend/database/prisma.yml
@@ -15,5 +15,6 @@ datamodel: datamodel.graphql
# seed:
# import: seed.graphql
-cluster: ${env:PRISMA_CLUSTER}
+# cluster: ${env:PRISMA_CLUSTER}
+cluster: local