Календарь: история действий с отменой для админа

This commit is contained in:
dev
2026-11-28 13:32:49 +03:00
parent c74042f297
commit 84ed0adc74
9 changed files with 785 additions and 59 deletions
+14
View File
@@ -896,3 +896,17 @@ CREATE TABLE IF NOT EXISTS calendar_reminder_sent (
UNIQUE (event_id, user_id, occurrence_at, minutes)
);
CREATE INDEX IF NOT EXISTS idx_calendar_reminder_sent_sent_at ON calendar_reminder_sent(sent_at);
CREATE TABLE IF NOT EXISTS calendar_action_log (
id BIGSERIAL PRIMARY KEY,
event_ids INT[] NOT NULL DEFAULT '{}',
user_id INT REFERENCES users(id) ON DELETE SET NULL,
user_name VARCHAR(200) NOT NULL DEFAULT '',
action VARCHAR(30) NOT NULL,
title VARCHAR(500) NOT NULL DEFAULT '',
before_state JSONB NOT NULL DEFAULT '[]'::jsonb,
after_state JSONB NOT NULL DEFAULT '[]'::jsonb,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_calendar_action_log_created ON calendar_action_log(id DESC);
CREATE INDEX IF NOT EXISTS idx_calendar_action_log_user ON calendar_action_log(user_id, id DESC);