159 lines
4.9 KiB
Plaintext
159 lines
4.9 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model all_auth_recipe_users {
|
|
user_id String @id @db.Char(36)
|
|
recipe_id String @db.VarChar(128)
|
|
time_joined BigInt
|
|
userid_mapping userid_mapping?
|
|
|
|
@@index([time_joined(sort: Desc), user_id(sort: Desc)], map: "all_auth_recipe_users_pagination_index")
|
|
}
|
|
|
|
model emailpassword_pswd_reset_tokens {
|
|
user_id String @db.Char(36)
|
|
token String @unique @db.VarChar(128)
|
|
token_expiry BigInt
|
|
emailpassword_users emailpassword_users @relation(fields: [user_id], references: [user_id], onDelete: Cascade)
|
|
|
|
@@id([user_id, token])
|
|
@@index([token_expiry], map: "emailpassword_password_reset_token_expiry_index")
|
|
}
|
|
|
|
model emailpassword_users {
|
|
user_id String @id @db.Char(36)
|
|
email String @unique @db.VarChar(256)
|
|
password_hash String @db.VarChar(128)
|
|
time_joined BigInt
|
|
emailpassword_pswd_reset_tokens emailpassword_pswd_reset_tokens[]
|
|
}
|
|
|
|
model emailverification_tokens {
|
|
user_id String @db.VarChar(128)
|
|
email String @db.VarChar(256)
|
|
token String @unique @db.VarChar(128)
|
|
token_expiry BigInt
|
|
|
|
@@id([user_id, email, token])
|
|
@@index([token_expiry], map: "emailverification_tokens_index")
|
|
}
|
|
|
|
model emailverification_verified_emails {
|
|
user_id String @db.VarChar(128)
|
|
email String @db.VarChar(256)
|
|
|
|
@@id([user_id, email])
|
|
}
|
|
|
|
model jwt_signing_keys {
|
|
key_id String @id @db.VarChar(255)
|
|
key_string String
|
|
algorithm String @db.VarChar(10)
|
|
created_at BigInt?
|
|
}
|
|
|
|
model key_value {
|
|
name String @id @db.VarChar(128)
|
|
value String?
|
|
created_at_time BigInt?
|
|
}
|
|
|
|
model passwordless_codes {
|
|
code_id String @id @db.Char(36)
|
|
device_id_hash String @db.Char(44)
|
|
link_code_hash String @unique @db.Char(44)
|
|
created_at BigInt
|
|
passwordless_devices passwordless_devices @relation(fields: [device_id_hash], references: [device_id_hash], onDelete: Cascade)
|
|
|
|
@@index([created_at], map: "passwordless_codes_created_at_index")
|
|
@@index([device_id_hash], map: "passwordless_codes_device_id_hash_index")
|
|
}
|
|
|
|
model passwordless_devices {
|
|
device_id_hash String @id @db.Char(44)
|
|
email String? @db.VarChar(256)
|
|
phone_number String? @db.VarChar(256)
|
|
link_code_salt String @db.Char(44)
|
|
failed_attempts Int
|
|
passwordless_codes passwordless_codes[]
|
|
|
|
@@index([email], map: "passwordless_devices_email_index")
|
|
@@index([phone_number], map: "passwordless_devices_phone_number_index")
|
|
}
|
|
|
|
model passwordless_users {
|
|
user_id String @id @db.Char(36)
|
|
email String? @unique @db.VarChar(256)
|
|
phone_number String? @unique @db.VarChar(256)
|
|
time_joined BigInt
|
|
}
|
|
|
|
model role_permissions {
|
|
role String @db.VarChar(255)
|
|
permission String @db.VarChar(255)
|
|
roles roles @relation(fields: [role], references: [role], onDelete: Cascade, onUpdate: NoAction)
|
|
|
|
@@id([role, permission])
|
|
@@index([permission], map: "role_permissions_permission_index")
|
|
}
|
|
|
|
model roles {
|
|
role String @id @db.VarChar(255)
|
|
role_permissions role_permissions[]
|
|
user_roles user_roles[]
|
|
}
|
|
|
|
model session_access_token_signing_keys {
|
|
created_at_time BigInt @id
|
|
value String?
|
|
}
|
|
|
|
model session_info {
|
|
session_handle String @id @db.VarChar(255)
|
|
user_id String @db.VarChar(128)
|
|
refresh_token_hash_2 String @db.VarChar(128)
|
|
session_data String?
|
|
expires_at BigInt
|
|
created_at_time BigInt
|
|
jwt_user_payload String?
|
|
}
|
|
|
|
model thirdparty_users {
|
|
third_party_id String @db.VarChar(28)
|
|
third_party_user_id String @db.VarChar(128)
|
|
user_id String @unique @db.Char(36)
|
|
email String @db.VarChar(256)
|
|
time_joined BigInt
|
|
|
|
@@id([third_party_id, third_party_user_id])
|
|
}
|
|
|
|
model user_metadata {
|
|
user_id String @id @db.VarChar(128)
|
|
user_metadata String
|
|
}
|
|
|
|
model user_roles {
|
|
user_id String @db.VarChar(128)
|
|
role String @db.VarChar(255)
|
|
roles roles @relation(fields: [role], references: [role], onDelete: Cascade, onUpdate: NoAction)
|
|
|
|
@@id([user_id, role])
|
|
@@index([role], map: "user_roles_role_index")
|
|
}
|
|
|
|
model userid_mapping {
|
|
supertokens_user_id String @unique @db.Char(36)
|
|
external_user_id String @unique @db.VarChar(128)
|
|
external_user_id_info String?
|
|
all_auth_recipe_users all_auth_recipe_users @relation(fields: [supertokens_user_id], references: [user_id], onDelete: Cascade, onUpdate: NoAction)
|
|
|
|
@@id([supertokens_user_id, external_user_id])
|
|
}
|