From fa3ec3299b3fa33e5a699683beb96cfa4e6dd51d Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Tue, 13 Feb 2018 13:19:23 -0500 Subject: getting there --- backend/database/datamodel.graphql | 13 ++++++++++++- backend/database/prisma.yml | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'backend/database') 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 -- cgit v1.3