Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store: Fix change_health_column migration for sharded setup #5183

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
$$;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to do the same in the down migration too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the down migration, and I think that is fine, since when we run the down migration, the imported tables don't reference anything.


drop type subgraphs."health";
Loading