From 149a19f32b3e8f5259a3cea002dbef31a7280c7c Mon Sep 17 00:00:00 2001
From: ilotterytea <iltsu@alright.party>
Date: Wed, 16 Apr 2025 23:06:19 +0500
Subject: upd: events table

---
 migrations/2024-05-11T02-53-05_init/up.sql | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

(limited to 'migrations/2024-05-11T02-53-05_init/up.sql')

diff --git a/migrations/2024-05-11T02-53-05_init/up.sql b/migrations/2024-05-11T02-53-05_init/up.sql
index 1a23ff9..2d4d8c2 100644
--- a/migrations/2024-05-11T02-53-05_init/up.sql
+++ b/migrations/2024-05-11T02-53-05_init/up.sql
@@ -43,14 +43,10 @@ CREATE TABLE IF NOT EXISTS "actions" (
 CREATE TABLE IF NOT EXISTS "events" (
   "id" SERIAL NOT NULL UNIQUE PRIMARY KEY,
   "channel_id" INTEGER NOT NULL REFERENCES "channels"("id") ON DELETE CASCADE,
-  "target_alias_id" INTEGER,
-  "custom_alias_id" VARCHAR,
+  "name" VARCHAR NOT NULL,
   "event_type" INTEGER NOT NULL,
   "flags" INTEGER[] NOT NULL DEFAULT ARRAY[]::INTEGER[],
-  "message" VARCHAR NOT NULL,
-
-  CONSTRAINT check_target_alias_id CHECK (("target_alias_id" IS NULL AND "custom_alias_id" IS NOT NULL) OR ("target_alias_id" IS NOT NULL AND "custom_alias_id" IS NULL)),
-  CONSTRAINT check_event_type CHECK (("target_alias_id" IS NOT NULL AND "event_type" != 99) OR ("custom_alias_id" IS NOT NULL AND "event_type" = 99))
+  "message" VARCHAR NOT NULL
 );
 
 CREATE TABLE IF NOT EXISTS "event_subscriptions" (
-- 
cgit v1.2.3

