57 lines
1.3 KiB
Plaintext
57 lines
1.3 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
previewFeatures = ["interactiveTransactions"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Listing {
|
|
id Int @id
|
|
seller Int
|
|
data Json
|
|
|
|
wantId String @db.Uuid
|
|
want Want @relation(fields: [wantId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@index([seller])
|
|
@@map("listings")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
email String @unique
|
|
password String
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
wants Want[]
|
|
|
|
@@map("users")
|
|
}
|
|
|
|
model Want {
|
|
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
release Int
|
|
data Json
|
|
|
|
userId String @db.Uuid
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
listings Listing[]
|
|
|
|
@@unique([userId, release])
|
|
@@index([release])
|
|
|
|
@@map("wants")
|
|
}
|