fix: 复合主键表改为单字段 id 以支持 ent 完整生成

This commit is contained in:
zetaloop
2026-04-24 07:32:52 +08:00
parent c62d743320
commit 5ad579f03c
19 changed files with 324 additions and 82 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
CREATE TABLE shop_players
(
id BIGINT PRIMARY KEY,
shop_id BIGINT NOT NULL REFERENCES shops (id),
player_id BIGINT NOT NULL,
@@ -8,7 +9,7 @@ CREATE TABLE shop_players
joined_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
left_at TIMESTAMPTZ, -- 软删除,表示已离职
PRIMARY KEY (shop_id, player_id)
UNIQUE (shop_id, player_id)
);
-- 索引