Skip to content

Commit

Permalink
store: Fix change_health_column migration for sharded setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lutter committed Jan 31, 2024
1 parent d7be543 commit 6067090
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,20 @@ alter table
rename column
health_new to health;

-- Drop imported subgraph_deployment tables from other shards so that we
-- can drop our local 'health' type
-- graph-node startup will recreate the foreign table import
do $$
declare r record;
begin
for r in select foreign_table_schema as nsp
from information_schema.foreign_tables
where foreign_table_schema like 'shard_%'
and foreign_table_name = 'subgraph_deployment'
loop
execute 'drop foreign table ' || r.nsp || '.subgraph_deployment';
end loop;
end
$$;

drop type subgraphs."health";

0 comments on commit 6067090

Please sign in to comment.