Files
quyun-v2/backend/database/.transform.yaml
2025-12-17 22:28:47 +08:00

58 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
ignores:
- migrations
- river_client
- river_client_queue
- river_job
- river_leader
- river_migration
- river_queue
imports:
- go.ipao.vip/gen
- quyun/v2/pkg/consts
field_type:
users:
roles: types.Array[consts.Role]
status: consts.UserStatus
tenants:
uuid: types.UUID
status: consts.TenantStatus
tenant_users:
role: types.Array[consts.TenantUserRole]
status: consts.UserStatus
media_assets:
type: consts.MediaAssetType
status: consts.MediaAssetStatus
contents:
status: consts.ContentStatus
visibility: consts.ContentVisibility
content_assets:
role: consts.ContentAssetRole
content_prices:
currency: consts.Currency
discount_type: consts.DiscountType
content_access:
status: consts.ContentAccessStatus
field_relate:
users:
OwnedTenant:
relation: belongs_to
table: tenants
json: owned
Tenants:
json: tenants
relation: many_to_many
table: tenants
pivot: tenant_users
# foreign_key: user_id # 当前表users用于关联的键转为结构体字段名 user_id
join_foreign_key: user_id # 中间表中指向当前表的列tenant_users.user_id
# references: id # 关联表tenants被引用的列转为结构体字段名 ID
join_references: tenant_id # 中间表中指向关联表的列tenant_users.tenant_id
tenants:
Users:
relation: many_to_many
table: users
pivot: tenant_users
json: users
join_foreign_key: tenant_id
join_references: user_id