40 lines
757 B
Plaintext
40 lines
757 B
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
sub String @id
|
|
lastPixelTime DateTime @default(now())
|
|
|
|
pixels Pixel[]
|
|
}
|
|
|
|
model PalleteColor {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
hex String @unique
|
|
|
|
pixels Pixel[]
|
|
}
|
|
|
|
model Pixel {
|
|
id Int @id @default(autoincrement())
|
|
userId String
|
|
x Int
|
|
y Int
|
|
color String
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
user User @relation(fields: [userId], references: [sub])
|
|
pallete PalleteColor @relation(fields: [color], references: [hex])
|
|
}
|