Files
base/database/schema/account.pg.hcl
2026-04-10 18:25:21 +03:30

62 lines
1007 B
HCL

table "accounts" {
schema = schema.public
column "id" {
type = uuid
null = false
}
column "user_id" {
type = uuid
null = false
}
column "password" {
null = true
type = text
}
column "access_token" {
null = true
type = text
}
column "refresh_token" {
null = true
type = text
}
column "scope" {
null = true
type = text
}
column "meta" {
null = true
type = jsonb
}
column "created_at" {
type = timestamptz
default = sql("now()")
null = false
}
column "updated_at" {
type = timestamptz
null = true
default = sql("now()")
}
column "deleted_at" {
type = timestamptz
null = true
}
primary_key {
columns = [column.id]
}
foreign_key "accounts_user_id_fk" {
columns = [column.user_id]
ref_columns = [table.users.column.id]
on_delete = CASCADE
on_update = CASCADE
}
index "accounts_user_id_idx" {
columns = [column.user_id]
}
}