mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-11 07:34:11 +03:00
91c3040db7
Co-authored-by: himself65 <himself65@outlook.com>
53 lines
1.5 KiB
Plaintext
53 lines
1.5 KiB
Plaintext
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
model google_users {
|
|
id String @id @db.VarChar
|
|
user_id String @db.VarChar
|
|
google_id String @unique @db.VarChar
|
|
users users @relation(fields: [user_id], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model permissions {
|
|
id String @id @db.VarChar
|
|
workspace_id String @db.VarChar
|
|
user_id String? @db.VarChar
|
|
user_email String?
|
|
type Int @db.SmallInt
|
|
accepted Boolean @default(false)
|
|
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
users users? @relation(fields: [user_id], references: [id], onDelete: Cascade)
|
|
workspaces workspaces @relation(fields: [workspace_id], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model seaql_migrations {
|
|
version String @id @db.VarChar
|
|
applied_at BigInt
|
|
}
|
|
|
|
model users {
|
|
id String @id @db.VarChar
|
|
name String @db.VarChar
|
|
email String @unique @db.VarChar
|
|
avatar_url String? @db.VarChar
|
|
token_nonce Int? @default(0) @db.SmallInt
|
|
password String? @db.VarChar
|
|
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
google_users google_users[]
|
|
permissions permissions[]
|
|
}
|
|
|
|
model workspaces {
|
|
id String @id @db.VarChar
|
|
public Boolean
|
|
type Int @db.SmallInt
|
|
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
permissions permissions[]
|
|
}
|