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]
|
||||
}
|
||||
}
|
||||
207
database/schema/asset.pg.hcl
Normal file
207
database/schema/asset.pg.hcl
Normal file
@@ -0,0 +1,207 @@
|
||||
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]
|
||||
}
|
||||
}
|
||||
31
database/schema/cache_hash.pg.hcl
Normal file
31
database/schema/cache_hash.pg.hcl
Normal file
@@ -0,0 +1,31 @@
|
||||
table "cache_hash" {
|
||||
schema = schema.public
|
||||
column "key" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
column "field" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
column "value" {
|
||||
type = jsonb
|
||||
null = false
|
||||
}
|
||||
column "created_at" {
|
||||
type = timestamptz
|
||||
null = false
|
||||
default = sql("now()")
|
||||
}
|
||||
column "expires_at" {
|
||||
type = timestamptz
|
||||
null = true
|
||||
}
|
||||
primary_key {
|
||||
columns = [column.key, column.field]
|
||||
}
|
||||
|
||||
index "idx_cache_hash_expires_at" {
|
||||
columns = [column.expires_at]
|
||||
}
|
||||
}
|
||||
28
database/schema/cache_kv.pg.hcl
Normal file
28
database/schema/cache_kv.pg.hcl
Normal file
@@ -0,0 +1,28 @@
|
||||
table "cache_kv" {
|
||||
schema = schema.public
|
||||
column "key" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
column "value" {
|
||||
type = jsonb
|
||||
null = false
|
||||
}
|
||||
column "created_at" {
|
||||
type = timestamptz
|
||||
null = false
|
||||
default = sql("now()")
|
||||
}
|
||||
column "expires_at" {
|
||||
type = timestamptz
|
||||
null = true
|
||||
}
|
||||
|
||||
primary_key {
|
||||
columns = [column.key]
|
||||
}
|
||||
|
||||
index "idx_cache_kv_expires_at" {
|
||||
columns = [column.expires_at]
|
||||
}
|
||||
}
|
||||
3
database/schema/platform.pg.hcl
Normal file
3
database/schema/platform.pg.hcl
Normal file
@@ -0,0 +1,3 @@
|
||||
schema "platform" {
|
||||
comment = "Platform schema for cache tables"
|
||||
}
|
||||
324
database/schema/profile.pg.hcl
Normal file
324
database/schema/profile.pg.hcl
Normal file
@@ -0,0 +1,324 @@
|
||||
table "profiles" {
|
||||
schema = schema.public
|
||||
|
||||
column "id" {
|
||||
type = uuid
|
||||
default = sql("gen_random_uuid()")
|
||||
null = false
|
||||
}
|
||||
column "user_id" {
|
||||
type = uuid
|
||||
null = true
|
||||
}
|
||||
column "handle" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
|
||||
// Hero fields
|
||||
column "role_id" {
|
||||
type = uuid
|
||||
null = true
|
||||
}
|
||||
column "role_name" {
|
||||
type = varchar(100)
|
||||
null = true
|
||||
}
|
||||
column "role_level" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
column "first_name" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
column "last_name" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
column "company" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
column "short_description" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
column "resume_link" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
column "cta_enabled" {
|
||||
type = boolean
|
||||
default = false
|
||||
null = false
|
||||
}
|
||||
column "avatar" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
|
||||
// About fields
|
||||
column "profile_picture" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
column "about" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
|
||||
// Contact fields
|
||||
column "email" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
column "phone" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
|
||||
// PageSetting fields
|
||||
column "visibility_level" {
|
||||
type = text
|
||||
default = "public"
|
||||
null = false
|
||||
}
|
||||
|
||||
// Complex data
|
||||
column "page_section_order" {
|
||||
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 "profiles_role_id_profile_roles_fk" {
|
||||
columns = [column.role_id]
|
||||
ref_columns = [table.profile_roles.column.id]
|
||||
on_delete = SET_NULL
|
||||
on_update = CASCADE
|
||||
}
|
||||
|
||||
unique "profiles_handle_unique" {
|
||||
columns = [column.handle]
|
||||
}
|
||||
|
||||
index "profiles_user_id_idx" {
|
||||
columns = [column.user_id]
|
||||
}
|
||||
|
||||
index "profiles_role_id_idx" {
|
||||
columns = [column.role_id]
|
||||
}
|
||||
|
||||
index "profiles_name_idx" {
|
||||
columns = [column.first_name, column.last_name]
|
||||
}
|
||||
|
||||
index "profiles_company_idx" {
|
||||
columns = [column.company]
|
||||
}
|
||||
|
||||
index "profiles_email_idx" {
|
||||
columns = [column.email]
|
||||
}
|
||||
|
||||
index "profiles_deleted_at_idx" {
|
||||
columns = [column.deleted_at]
|
||||
}
|
||||
}
|
||||
|
||||
table "profile_skills" {
|
||||
schema = schema.public
|
||||
|
||||
column "id" {
|
||||
type = uuid
|
||||
default = sql("gen_random_uuid()")
|
||||
null = false
|
||||
}
|
||||
column "profile_id" {
|
||||
type = uuid
|
||||
null = false
|
||||
}
|
||||
column "skill_name" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
column "level" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
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 "profile_skills_profile_id_fk" {
|
||||
columns = [column.profile_id]
|
||||
ref_columns = [table.profiles.column.id]
|
||||
on_delete = CASCADE
|
||||
on_update = CASCADE
|
||||
}
|
||||
|
||||
index "skills_profile_id_idx" {
|
||||
columns = [column.profile_id]
|
||||
}
|
||||
|
||||
index "skills_name_idx" {
|
||||
columns = [column.skill_name]
|
||||
}
|
||||
|
||||
index "profile_skills_deleted_at_idx" {
|
||||
columns = [column.deleted_at]
|
||||
}
|
||||
}
|
||||
|
||||
table "profile_social_links" {
|
||||
schema = schema.public
|
||||
|
||||
column "id" {
|
||||
type = uuid
|
||||
default = sql("gen_random_uuid()")
|
||||
null = false
|
||||
}
|
||||
column "profile_id" {
|
||||
type = uuid
|
||||
null = false
|
||||
}
|
||||
column "link_type" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
column "link" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
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 "profile_social_links_profile_id_fk" {
|
||||
columns = [column.profile_id]
|
||||
ref_columns = [table.profiles.column.id]
|
||||
on_delete = CASCADE
|
||||
on_update = CASCADE
|
||||
}
|
||||
|
||||
index "social_links_profile_id_idx" {
|
||||
columns = [column.profile_id]
|
||||
}
|
||||
|
||||
index "profile_social_links_deleted_at_idx" {
|
||||
columns = [column.deleted_at]
|
||||
}
|
||||
}
|
||||
|
||||
table "profile_achievements" {
|
||||
schema = schema.public
|
||||
|
||||
column "id" {
|
||||
type = uuid
|
||||
default = sql("gen_random_uuid()")
|
||||
null = false
|
||||
}
|
||||
column "profile_id" {
|
||||
type = uuid
|
||||
null = false
|
||||
}
|
||||
column "title" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
column "value" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
column "enabled" {
|
||||
type = boolean
|
||||
default = true
|
||||
null = false
|
||||
}
|
||||
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 "profile_achievements_profile_id_fk" {
|
||||
columns = [column.profile_id]
|
||||
ref_columns = [table.profiles.column.id]
|
||||
on_delete = CASCADE
|
||||
on_update = CASCADE
|
||||
}
|
||||
|
||||
index "achievements_profile_id_idx" {
|
||||
columns = [column.profile_id]
|
||||
}
|
||||
|
||||
index "profile_achievements_deleted_at_idx" {
|
||||
columns = [column.deleted_at]
|
||||
}
|
||||
}
|
||||
|
||||
44
database/schema/profile_roles.pg.hcl
Normal file
44
database/schema/profile_roles.pg.hcl
Normal file
@@ -0,0 +1,44 @@
|
||||
table "profile_roles" {
|
||||
schema = schema.public
|
||||
|
||||
column "id" {
|
||||
type = uuid
|
||||
default = sql("gen_random_uuid()")
|
||||
null = false
|
||||
}
|
||||
column "title" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
column "status" {
|
||||
type = text
|
||||
default = "active"
|
||||
null = false
|
||||
}
|
||||
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 "profile_roles_status_idx" {
|
||||
columns = [column.status]
|
||||
}
|
||||
|
||||
index "profile_roles_deleted_at_idx" {
|
||||
columns = [column.deleted_at]
|
||||
}
|
||||
}
|
||||
3
database/schema/public.pg.hcl
Normal file
3
database/schema/public.pg.hcl
Normal file
@@ -0,0 +1,3 @@
|
||||
schema "public" {
|
||||
comment = "Standard public schema"
|
||||
}
|
||||
39
database/schema/role.pg.hcl
Normal file
39
database/schema/role.pg.hcl
Normal file
@@ -0,0 +1,39 @@
|
||||
table "roles" {
|
||||
schema = schema.public
|
||||
|
||||
column "id" {
|
||||
type = uuid
|
||||
null = false
|
||||
}
|
||||
column "name" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
column "description" {
|
||||
type = text
|
||||
null = true
|
||||
}
|
||||
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]
|
||||
}
|
||||
|
||||
unique "roles_name_unique" {
|
||||
columns = [column.name]
|
||||
}
|
||||
}
|
||||
3
database/schema/schema.pg.hcl
Normal file
3
database/schema/schema.pg.hcl
Normal file
@@ -0,0 +1,3 @@
|
||||
schema "public" {
|
||||
|
||||
}
|
||||
35
database/schema/skills.pg.hcl
Normal file
35
database/schema/skills.pg.hcl
Normal file
@@ -0,0 +1,35 @@
|
||||
table "skills" {
|
||||
schema = schema.public
|
||||
|
||||
column "id" {
|
||||
type = uuid
|
||||
default = sql("gen_random_uuid()")
|
||||
null = false
|
||||
}
|
||||
column "name" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
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 "skills_catalog_name_idx" {
|
||||
columns = [column.name]
|
||||
}
|
||||
}
|
||||
45
database/schema/user.pg.hcl
Normal file
45
database/schema/user.pg.hcl
Normal file
@@ -0,0 +1,45 @@
|
||||
table "users" {
|
||||
schema = schema.public
|
||||
|
||||
column "id" {
|
||||
type = uuid
|
||||
null = false
|
||||
}
|
||||
column "first_name" {
|
||||
type = text
|
||||
}
|
||||
column "last_name" {
|
||||
type = text
|
||||
}
|
||||
column "display_name" {
|
||||
type = text
|
||||
}
|
||||
column "email" {
|
||||
type = text
|
||||
null = false
|
||||
}
|
||||
|
||||
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]
|
||||
}
|
||||
|
||||
unique "users_email_unique" {
|
||||
columns = [column.email]
|
||||
}
|
||||
}
|
||||
56
database/schema/user_role.pg.hcl
Normal file
56
database/schema/user_role.pg.hcl
Normal file
@@ -0,0 +1,56 @@
|
||||
table "user_roles" {
|
||||
schema = schema.public
|
||||
|
||||
column "id" {
|
||||
type = uuid
|
||||
null = false
|
||||
}
|
||||
|
||||
column "user_id" {
|
||||
type = uuid
|
||||
null = false
|
||||
}
|
||||
column "role_id" {
|
||||
type = uuid
|
||||
null = false
|
||||
}
|
||||
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 "user_roles_user_id_fk" {
|
||||
columns = [column.user_id]
|
||||
ref_columns = [table.users.column.id]
|
||||
on_delete = CASCADE
|
||||
on_update = CASCADE
|
||||
}
|
||||
foreign_key "user_roles_role_id_fk" {
|
||||
columns = [column.role_id]
|
||||
ref_columns = [table.roles.column.id]
|
||||
on_delete = CASCADE
|
||||
on_update = CASCADE
|
||||
}
|
||||
|
||||
index "user_roles_user_id_idx" {
|
||||
columns = [column.user_id]
|
||||
}
|
||||
index "user_roles_role_id_idx" {
|
||||
columns = [column.role_id]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user