From 6eb8d046faf20c826b519970bf03ff8bd47906f6 Mon Sep 17 00:00:00 2001 From: Dull Bananas Date: Mon, 20 May 2024 21:21:48 +0000 Subject: [PATCH] finish fixing migrations --- crates/db_schema/src/schema_setup/diff_check.rs | 2 +- .../down.sql | 2 +- migrations/2024-02-24-034523_replaceable-schema/down.sql | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/db_schema/src/schema_setup/diff_check.rs b/crates/db_schema/src/schema_setup/diff_check.rs index e3e941507..67de872dd 100644 --- a/crates/db_schema/src/schema_setup/diff_check.rs +++ b/crates/db_schema/src/schema_setup/diff_check.rs @@ -149,7 +149,7 @@ pub fn check_dump_diff(conn: &mut PgConnection, mut before: String, name: &str) } .expect("failed to build string"); } - write!(&mut output, "\n{most_similar_chunk_filtered}"); + //write!(&mut output, "\n{most_similar_chunk_filtered}"); if !chunks_gt.is_empty() { chunks_gt.swap_remove(most_similar_chunk_index);} } diff --git a/migrations/2023-10-24-030352_change_primary_keys_and_remove_some_id_columns/down.sql b/migrations/2023-10-24-030352_change_primary_keys_and_remove_some_id_columns/down.sql index b5078355e..bebadd999 100644 --- a/migrations/2023-10-24-030352_change_primary_keys_and_remove_some_id_columns/down.sql +++ b/migrations/2023-10-24-030352_change_primary_keys_and_remove_some_id_columns/down.sql @@ -148,7 +148,7 @@ ALTER TABLE post_read ALTER TABLE received_activity ADD UNIQUE (ap_id), DROP CONSTRAINT received_activity_pkey, - ADD COLUMN id serial PRIMARY KEY; + ADD COLUMN id bigserial PRIMARY KEY; CREATE INDEX idx_post_saved_person_id ON post_saved (person_id); diff --git a/migrations/2024-02-24-034523_replaceable-schema/down.sql b/migrations/2024-02-24-034523_replaceable-schema/down.sql index db8feacdf..cbdbadb37 100644 --- a/migrations/2024-02-24-034523_replaceable-schema/down.sql +++ b/migrations/2024-02-24-034523_replaceable-schema/down.sql @@ -945,6 +945,13 @@ CREATE TRIGGER site_aggregates_comment_insert WHEN ((new.local = TRUE)) EXECUTE FUNCTION site_aggregates_comment_insert (); +CREATE TRIGGER site_aggregates_community_delete + AFTER DELETE OR UPDATE OF removed, + deleted ON community + FOR EACH ROW + WHEN (OLD.local = TRUE) + EXECUTE PROCEDURE site_aggregates_community_delete (); + CREATE TRIGGER site_aggregates_community_insert AFTER INSERT OR UPDATE OF removed, deleted ON community