cal.pub0.org/prisma/schema.prisma

47 lines
1.2 KiB
Plaintext

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model EventType {
id Int @default(autoincrement()) @id
title String
slug String
description String?
length Int
hidden Boolean @default(false)
user User? @relation(fields: [userId], references: [id])
userId Int?
}
model Credential {
id Int @default(autoincrement()) @id
type String
key Json
user User? @relation(fields: [userId], references: [id])
userId Int?
}
model User {
id Int @default(autoincrement()) @id
username String?
name String?
email String? @unique
password String?
bio String?
avatar String?
timeZone String @default("Europe/London")
startTime Int @default(0)
endTime Int @default(1440)
createdDate DateTime @default(now()) @map(name: "created")
eventTypes EventType[]
credentials Credential[]
@@map(name: "users")
}