208 lines
3.5 KiB
HCL
208 lines
3.5 KiB
HCL
table "asset_categories" {
|
|
schema = schema.public
|
|
|
|
column "id" {
|
|
type = uuid
|
|
default = sql("gen_random_uuid()")
|
|
null = false
|
|
}
|
|
column "name" {
|
|
type = text
|
|
null = false
|
|
}
|
|
column "icon" {
|
|
type = text
|
|
null = true
|
|
}
|
|
column "color" {
|
|
type = text
|
|
null = true
|
|
}
|
|
column "card_type" {
|
|
type = text
|
|
null = true
|
|
}
|
|
column "featured" {
|
|
type = boolean
|
|
default = false
|
|
null = false
|
|
}
|
|
column "description" {
|
|
type = text
|
|
null = true
|
|
}
|
|
column "created_at" {
|
|
type = timestamptz
|
|
default = sql("now()")
|
|
null = false
|
|
}
|
|
column "updated_at" {
|
|
type = timestamptz
|
|
default = sql("now()")
|
|
null = false
|
|
}
|
|
column "deleted_at" {
|
|
type = timestamptz
|
|
null = true
|
|
}
|
|
|
|
primary_key {
|
|
columns = [column.id]
|
|
}
|
|
|
|
index "asset_categories_deleted_at_idx" {
|
|
columns = [column.deleted_at]
|
|
}
|
|
}
|
|
|
|
table "assets" {
|
|
schema = schema.public
|
|
|
|
column "id" {
|
|
type = uuid
|
|
default = sql("gen_random_uuid()")
|
|
null = false
|
|
}
|
|
column "profile_id" {
|
|
type = uuid
|
|
null = false
|
|
}
|
|
column "status" {
|
|
type = integer
|
|
default = 0
|
|
null = false
|
|
}
|
|
column "asset_category_id" {
|
|
type = uuid
|
|
null = false
|
|
}
|
|
column "title" {
|
|
type = text
|
|
null = false
|
|
}
|
|
column "description" {
|
|
type = text
|
|
null = true
|
|
}
|
|
column "link" {
|
|
type = text
|
|
null = true
|
|
}
|
|
column "analytics" {
|
|
type = jsonb
|
|
null = true
|
|
}
|
|
column "created_at" {
|
|
type = timestamptz
|
|
default = sql("now()")
|
|
null = false
|
|
}
|
|
column "updated_at" {
|
|
type = timestamptz
|
|
default = sql("now()")
|
|
null = false
|
|
}
|
|
column "deleted_at" {
|
|
type = timestamptz
|
|
null = true
|
|
}
|
|
|
|
primary_key {
|
|
columns = [column.id]
|
|
}
|
|
|
|
foreign_key "assets_profile_id_fk" {
|
|
columns = [column.profile_id]
|
|
ref_columns = [table.profiles.column.id]
|
|
on_delete = CASCADE
|
|
on_update = CASCADE
|
|
}
|
|
|
|
foreign_key "assets_asset_category_id_fk" {
|
|
columns = [column.asset_category_id]
|
|
ref_columns = [table.asset_categories.column.id]
|
|
on_delete = CASCADE
|
|
on_update = CASCADE
|
|
}
|
|
|
|
index "assets_profile_id_idx" {
|
|
columns = [column.profile_id]
|
|
}
|
|
|
|
index "assets_category_id_idx" {
|
|
columns = [column.asset_category_id]
|
|
}
|
|
|
|
index "assets_deleted_at_idx" {
|
|
columns = [column.deleted_at]
|
|
}
|
|
}
|
|
|
|
table "asset_artifacts" {
|
|
schema = schema.public
|
|
|
|
column "id" {
|
|
type = uuid
|
|
default = sql("gen_random_uuid()")
|
|
null = false
|
|
}
|
|
column "asset_id" {
|
|
type = uuid
|
|
null = false
|
|
}
|
|
column "type" {
|
|
type = text
|
|
null = false
|
|
}
|
|
column "download_url" {
|
|
type = text
|
|
null = true
|
|
}
|
|
column "price" {
|
|
type = integer
|
|
default = 0
|
|
null = false
|
|
}
|
|
column "title" {
|
|
type = text
|
|
null = true
|
|
}
|
|
column "description" {
|
|
type = text
|
|
null = true
|
|
}
|
|
column "created_at" {
|
|
type = timestamptz
|
|
default = sql("now()")
|
|
null = false
|
|
}
|
|
column "updated_at" {
|
|
type = timestamptz
|
|
default = sql("now()")
|
|
null = false
|
|
}
|
|
column "deleted_at" {
|
|
type = timestamptz
|
|
null = true
|
|
}
|
|
|
|
primary_key {
|
|
columns = [column.id]
|
|
}
|
|
|
|
foreign_key "asset_artifacts_asset_id_fk" {
|
|
columns = [column.asset_id]
|
|
ref_columns = [table.assets.column.id]
|
|
on_delete = CASCADE
|
|
on_update = CASCADE
|
|
}
|
|
|
|
index "asset_artifacts_asset_id_idx" {
|
|
columns = [column.asset_id]
|
|
}
|
|
|
|
index "asset_artifacts_deleted_at_idx" {
|
|
columns = [column.deleted_at]
|
|
}
|
|
}
|