File tree Expand file tree Collapse file tree
hasura/migrations/default
1761617285280_alter_table_public_match_map_veto_picks_add_unique_match_id_map_id
1761617297952_alter_table_public_match_region_veto_picks_add_unique_match_id_region Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ alter table " public" ." match_map_veto_picks" drop constraint " match_map_veto_picks_match_id_map_id_key" ;
Original file line number Diff line number Diff line change 1+ WITH duplicates AS (
2+ SELECT
3+ id,
4+ ROW_NUMBER() OVER (
5+ PARTITION BY match_id, map_id
6+ ORDER BY created_at ASC , id ASC
7+ ) as row_num
8+ FROM match_map_veto_picks
9+ )
10+ DELETE FROM match_map_veto_picks
11+ WHERE id IN (
12+ SELECT id
13+ FROM duplicates
14+ WHERE row_num > 1
15+ );
16+
17+ alter table " public" ." match_map_veto_picks" add constraint " match_map_veto_picks_match_id_map_id_key" unique (" match_id" , " map_id" );
Original file line number Diff line number Diff line change 1+ alter table " public" ." match_region_veto_picks" drop constraint " match_region_veto_picks_match_id_region_key" ;
Original file line number Diff line number Diff line change 1+ WITH duplicates AS (
2+ SELECT
3+ id,
4+ ROW_NUMBER() OVER (
5+ PARTITION BY match_id, region
6+ ORDER BY created_at ASC , id ASC
7+ ) as row_num
8+ FROM match_region_veto_picks
9+ )
10+ DELETE FROM match_region_veto_picks
11+ WHERE id IN (
12+ SELECT id
13+ FROM duplicates
14+ WHERE row_num > 1
15+ );
16+
17+ alter table " public" ." match_region_veto_picks" add constraint " match_region_veto_picks_match_id_region_key" unique (" match_id" , " region" );
You can’t perform that action at this time.
0 commit comments