summaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20241026174345_init.sql10
1 files changed, 10 insertions, 0 deletions
diff --git a/migrations/20241026174345_init.sql b/migrations/20241026174345_init.sql
index 49b840e..233ceba 100644
--- a/migrations/20241026174345_init.sql
+++ b/migrations/20241026174345_init.sql
@@ -91,6 +91,16 @@ BEGIN
END
-- +goose StatementEnd
+-- +goose StatementBegin
+CREATE TRIGGER on_frequency_delete
+AFTER DELETE ON frequencies
+BEGIN
+ UPDATE frequencies SET
+ position = position - 1
+ WHERE network_id = OLD.network_id AND position > OLD.position;
+END
+-- +goose StatementEnd
+
-- +goose Down
DROP TABLE messages;
DROP TABLE users;