From 857d9505fe9b5e4405ad1bde5f4a3ea9fe1f6653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Avila?= Date: Sun, 20 Aug 2023 05:59:22 -0500 Subject: [PATCH] Removes unnecessary ALTER TABLE in down migration --- database/migrations/20230820013540_update_folder_size.sql | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/database/migrations/20230820013540_update_folder_size.sql b/database/migrations/20230820013540_update_folder_size.sql index f981936..7b859dc 100644 --- a/database/migrations/20230820013540_update_folder_size.sql +++ b/database/migrations/20230820013540_update_folder_size.sql @@ -43,7 +43,7 @@ $$ LANGUAGE plpgsql; -- +goose StatementEnd -- +goose StatementBegin -CREATE TRIGGER update_folder_size_after_insert_or_update +CREATE TRIGGER update_folder_size_after_insert_update_delete AFTER INSERT OR UPDATE OR DELETE ON teldrive.files FOR EACH ROW EXECUTE PROCEDURE teldrive.update_size_function(); @@ -52,9 +52,6 @@ EXECUTE PROCEDURE teldrive.update_size_function(); -- +goose Down -- +goose StatementBegin - -DROP TRIGGER IF EXISTS update_folder_size_after_insert_or_update ON teldrive.files; +DROP TRIGGER IF EXISTS update_folder_size_after_insert_update_delete ON teldrive.files; DROP FUNCTION IF EXISTS teldrive.update_size_function; -ALTER TABLE teldrive.files -DROP COLUMN IF EXISTS trigger_executed; -- +goose StatementEnd