ecomm/prisma/schema.prisma

36 lines
777 B
Text
Raw Normal View History

2023-06-08 11:05:28 +00:00
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id String @id @default(cuid()) @map("_id")
firstName String
lastName String
email String @unique
password String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
2023-06-08 11:55:04 +00:00
}
model Item {
id String @id @default(cuid()) @map("_id")
name String
price Float
quantity Int @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Cart {
id String @id @default(cuid()) @map("_id")
userId String
itemId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([userId, itemId])
2023-06-08 11:05:28 +00:00
}