From b67ab26b89e16d4492145702b0ef899d3d6b7416 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sat, 23 Nov 2024 20:27:10 +0200 Subject: Added frequency queries --- migrations/20241026174345_init.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'migrations/20241026174345_init.sql') 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; -- cgit v1.3.1