Skip to content

Commit f7e8129

Browse files
committed
clean up migration script for pool stat
1 parent 8e6340f commit f7e8129

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,8 @@ BEGIN
1414
);
1515

1616
-- Then add constraint if it doesn't exist
17-
DO $$
18-
BEGIN
19-
IF NOT EXISTS (
20-
SELECT 1 FROM pg_constraint
21-
WHERE conname = 'unique_pool_stat_epoch'
22-
) THEN
23-
ALTER TABLE "pool_stat" ADD CONSTRAINT "unique_pool_stat_epoch"
17+
ALTER TABLE "pool_stat" ADD CONSTRAINT IF NOT EXISTS "unique_pool_stat_epoch"
2418
UNIQUE ("pool_hash_id", "epoch_no");
25-
END IF;
26-
END $$;
2719

2820
UPDATE schema_version SET stage_two = next_version ;
2921
RAISE NOTICE 'DB has been migrated to stage_two version %', next_version ;

0 commit comments

Comments
 (0)