initial commit
This commit is contained in:
62
database/schema/account.pg.hcl
Normal file
62
database/schema/account.pg.hcl
Normal file
@@ -0,0 +1,62 @@
|
||||
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]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user