From 3b91a009ea3812a07d2411744dd1596f3df31a46 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 May 2026 06:59:56 +0000 Subject: [PATCH] feat(#13): add calendar subscriptions migration --- .../Migrations/V011__add_calendar_subscriptions.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/GmRelay.Bot/Migrations/V011__add_calendar_subscriptions.sql diff --git a/src/GmRelay.Bot/Migrations/V011__add_calendar_subscriptions.sql b/src/GmRelay.Bot/Migrations/V011__add_calendar_subscriptions.sql new file mode 100644 index 0000000..dbfe1f8 --- /dev/null +++ b/src/GmRelay.Bot/Migrations/V011__add_calendar_subscriptions.sql @@ -0,0 +1,11 @@ +CREATE TABLE calendar_subscriptions ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + token TEXT UNIQUE NOT NULL, + user_telegram_id BIGINT NOT NULL, + group_id UUID REFERENCES game_groups(id) ON DELETE CASCADE, + filter_type SMALLINT NOT NULL DEFAULT 0, + created_at TIMESTAMPTZ NOT NULL DEFAULT now(), + expires_at TIMESTAMPTZ +); + +CREATE INDEX ix_calendar_subscriptions_user_telegram_id ON calendar_subscriptions (user_telegram_id);