From: kartikynwa Date: Thu, 22 Jun 2023 11:52:31 +0000 (+0530) Subject: Add migration to mark local communities as such (#3257) X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/%7Biframely.url%7D?a=commitdiff_plain;h=4f2fb68d6b469e7a531d9537a79c82d6c2202245;p=lemmy.git Add migration to mark local communities as such (#3257) --- 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 00000000..ae8c4c78 --- /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 00000000..cbe3be9e --- /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;