Reapply "Build post chat and attachment workflows"
Some checks failed
CI / frontend (push) Has been cancelled
CI / docker (push) Has been cancelled
CI / backend (push) Has been cancelled

This reverts commit 5bc4a551af.
This commit is contained in:
Cauê Faleiros
2026-06-10 09:24:44 -03:00
parent 5bc4a551af
commit 3314c2e863
30 changed files with 3021 additions and 204 deletions

View File

@@ -0,0 +1,11 @@
CREATE TABLE IF NOT EXISTS calendar_item_chat_messages (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
calendar_item_id UUID NOT NULL REFERENCES calendar_items(id) ON DELETE CASCADE,
channel TEXT NOT NULL CHECK (channel IN ('external', 'internal')),
body TEXT NOT NULL,
created_by UUID REFERENCES users(id) ON DELETE SET NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_calendar_item_chat_messages_item_channel
ON calendar_item_chat_messages (calendar_item_id, channel, created_at);