Created
February 8, 2024 21:52
-
-
Save tclain/4dd1344567936317b57e4d81d66944e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generator client { | |
provider = "prisma-client-js" | |
} | |
datasource db { | |
provider = "postgresql" | |
url = env("POSTGRES_PRISMA_URL") | |
directUrl = env("POSTGRES_URL_NON_POOLING") | |
} | |
model art { | |
id Int @id @default(autoincrement()) | |
title String? @db.VarChar(255) | |
description String? | |
artist_id Int? | |
file String? @db.VarChar(100) | |
url String? | |
artists artists? @relation(fields: [artist_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "fk_artist") | |
user_to_art user_to_art[] | |
} | |
model artists { | |
id Int @id @default(autoincrement()) | |
bio String? | |
art art[] | |
} | |
model auth_user { | |
id String @id @default(cuid()) | |
first_name String? | |
last_name String? | |
email String | |
artist_id Int? | |
user_key user_key[] | |
user_session user_session[] | |
device_to_user device_to_user[] | |
user_to_art user_to_art[] | |
} | |
model user_to_art { | |
id Int @id @default(autoincrement()) | |
user auth_user @relation(fields: [user_id], references: [id]) | |
user_id String | |
art art @relation(fields: [art_id], references: [id]) | |
art_id Int | |
last_view DateTime? @db.Date | |
} | |
model displays { | |
id Int @id @default(autoincrement()) | |
art_id Int? | |
last_refresh DateTime? @db.Date | |
visited Int[] | |
member_id String? @db.VarChar(15) | |
} | |
model user_key { | |
id String @id | |
user_id String | |
hashed_password String? | |
auth_user auth_user @relation(fields: [user_id], references: [id], onDelete: NoAction, onUpdate: NoAction) | |
} | |
model user_session { | |
id String @id | |
user_id String | |
active_expires BigInt | |
idle_expires BigInt | |
auth_user auth_user @relation(fields: [user_id], references: [id], onDelete: NoAction, onUpdate: NoAction) | |
} | |
model device { | |
id String @id | |
device_to_user device_to_user[] | |
} | |
model device_to_user { | |
id Int @id @default(autoincrement()) | |
device device @relation(fields: [device_id], references: [id], onDelete: NoAction, onUpdate: NoAction) | |
device_id String | |
pin String | |
user auth_user @relation(fields: [auth_userId], references: [id]) | |
auth_userId String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment