diff --git a/migrations/2023-06-22-051755_fix_local_communities_marked_non_local/down.sql b/migrations/2023-06-22-051755_fix_local_communities_marked_non_local/down.sql new file mode 100644 index 000000000..ae8c4c786 --- /dev/null +++ b/migrations/2023-06-22-051755_fix_local_communities_marked_non_local/down.sql @@ -0,0 +1,2 @@ +-- Add a no-op statement to prevent `diesel migration redo` errors +SELECT 1; diff --git a/migrations/2023-06-22-051755_fix_local_communities_marked_non_local/up.sql b/migrations/2023-06-22-051755_fix_local_communities_marked_non_local/up.sql new file mode 100644 index 000000000..cbe3be9e5 --- /dev/null +++ b/migrations/2023-06-22-051755_fix_local_communities_marked_non_local/up.sql @@ -0,0 +1,5 @@ +update community c +set local=true +from local_site ls + join site s on ls.site_id=s.id +where c.instance_id=s.instance_id and not c.local;