Files
tps-dashboard/backend/sql/002c_recreate_index_only.sql
T

10 lines
526 B
SQL

-- ============================================================
-- 002c_recreate_index_only.sql
-- 002b 跑半截翻车后补救:只执行 CREATE INDEX,不要再 DROP CONSTRAINT
-- 执行方式: psql -U postgres -d milsci_dev -f sql/002c_recreate_index_only.sql
-- 前置条件:先设 $env:PGCLIENTENCODING="UTF8"
-- ============================================================
CREATE UNIQUE INDEX idx_episodes_year_number
ON episodes (date_part('year', air_date), episode_number)
WHERE original_episode_id IS NULL;