refactor: 统一数据库约束维护位置
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-04-27 00:57:18 +08:00
parent ec1855dfac
commit ba1a1ffbea
3 changed files with 5 additions and 27 deletions

View File

@@ -19,12 +19,7 @@ CREATE TABLE IF NOT EXISTS config_spt (
description TEXT NOT NULL DEFAULT ''
);
ALTER TABLE config_spt DROP CONSTRAINT IF EXISTS idx_config_spt_task_id;
DROP INDEX IF EXISTS idx_config_spt_task_id;
CREATE UNIQUE INDEX IF NOT EXISTS idx_config_spt_task_id
ON config_spt(task_id)
WHERE deleted_at IS NULL;
-- task_id 唯一约束统一在 约束类.sql 中维护
ALTER TABLE config_spt DROP COLUMN IF EXISTS seat_id;