refactor-db #33

Merged
vivy-agent merged 42 commits from refactor-db into main 2026-05-26 21:33:21 +07:00
7 changed files with 6829 additions and 2386 deletions
Showing only changes of commit 0fec37e337 - Show all commits

View File

@ -38,6 +38,8 @@ model User {
country Country? @relation(fields: [countryId], references: [id], name: "UserCountry")
auth_provider String? @db.VarChar(64)
provider_token String? @db.VarChar(255)
address UserAddress?
preferences UserPreference?
created_at DateTime @default(now()) @db.Timestamptz()
updated_at DateTime @updatedAt @db.Timestamptz()
deleted_at DateTime? @db.Timestamptz()
@ -61,9 +63,25 @@ model UserPreference {
publish_partner Boolean @default(true)
subscribe_to_newsletter Boolean @default(true)
enable_security_alerts Boolean @default(true)
user User @relation(fields: [user_id], references: [id])
@@map("user_preferences")
}
model UserAddress {
user_id String @id @db.Uuid
address String @db.VarChar(255)
district String @db.VarChar(100)
city String @db.VarChar(100)
province String @db.VarChar(100)
postal_code String @db.VarChar(20)
coordinate String? @db.VarChar(50)
updated_at DateTime @updatedAt @db.Timestamptz()
user User @relation(fields: [user_id], references: [id])
@@map("user_addresses")
}
model Country {
id String @id @db.Uuid @default(uuid(7))
name String @db.VarChar(155)