Revert "Build post chat and attachment workflows"

This reverts commit 0b920da187.
This commit is contained in:
Cauê Faleiros
2026-06-09 15:57:45 -03:00
parent 0b920da187
commit 5bc4a551af
30 changed files with 204 additions and 3021 deletions

View File

@@ -1,11 +0,0 @@
CREATE TABLE IF NOT EXISTS refresh_tokens (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
token_hash TEXT NOT NULL UNIQUE,
expires_at TIMESTAMPTZ NOT NULL,
revoked_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_refresh_tokens_user_id ON refresh_tokens (user_id);
CREATE INDEX IF NOT EXISTS idx_refresh_tokens_token_hash ON refresh_tokens (token_hash);

View File

@@ -1,11 +0,0 @@
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);

View File

@@ -1,19 +0,0 @@
ALTER TABLE calendar_item_chat_messages
ADD COLUMN IF NOT EXISTS edited_at TIMESTAMPTZ,
ADD COLUMN IF NOT EXISTS deleted_at TIMESTAMPTZ;
CREATE TABLE IF NOT EXISTS calendar_item_chat_attachments (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
chat_message_id UUID NOT NULL REFERENCES calendar_item_chat_messages(id) ON DELETE CASCADE,
original_filename TEXT NOT NULL,
stored_filename TEXT NOT NULL,
mime_type TEXT NOT NULL,
size_bytes BIGINT NOT NULL CHECK (size_bytes >= 0),
storage_driver TEXT NOT NULL,
storage_path 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_attachments_message
ON calendar_item_chat_attachments (chat_message_id, created_at);