canvas/packages/server/prisma/schema.prisma

40 lines
757 B
Plaintext
Raw Normal View History

2024-01-26 18:38:41 -08:00
// 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])
}