chore: establish V1.1 recovery baseline

This commit is contained in:
2026-09-09 22:05:00 +08:00
commit b46b48eb33
947 changed files with 155471 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
-- Fix matches table
ALTER TABLE matches DROP CONSTRAINT IF EXISTS matches_user_a_id_fkey;
ALTER TABLE matches DROP CONSTRAINT IF EXISTS matches_user_b_id_fkey;
ALTER TABLE matches ALTER COLUMN user_a_id TYPE VARCHAR(36) USING user_a_id::text;
ALTER TABLE matches ALTER COLUMN user_b_id TYPE VARCHAR(36) USING user_b_id::text;
ALTER TABLE matches ADD CONSTRAINT matches_user_a_id_fkey FOREIGN KEY (user_a_id) REFERENCES users(id);
ALTER TABLE matches ADD CONSTRAINT matches_user_b_id_fkey FOREIGN KEY (user_b_id) REFERENCES users(id);
-- Fix user_relations table
ALTER TABLE user_relations DROP CONSTRAINT IF EXISTS user_relations_user_id_fkey;
ALTER TABLE user_relations DROP CONSTRAINT IF EXISTS user_relations_target_user_id_fkey;
ALTER TABLE user_relations ALTER COLUMN user_id TYPE VARCHAR(36) USING user_id::text;
ALTER TABLE user_relations ALTER COLUMN target_user_id TYPE VARCHAR(36) USING target_user_id::text;
ALTER TABLE user_relations ADD CONSTRAINT user_relations_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
ALTER TABLE user_relations ADD CONSTRAINT user_relations_target_user_id_fkey FOREIGN KEY (target_user_id) REFERENCES users(id);