feat: integrate comments UI into chat messages

This commit is contained in:
CREDO23 2026-01-16 15:09:51 +02:00
parent f591a872cf
commit 6b5468bd7d
7 changed files with 74 additions and 29 deletions

View file

@ -26,15 +26,21 @@ def upgrade() -> None:
content TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Create indexes
CREATE INDEX IF NOT EXISTS idx_chat_comments_message_id ON chat_comments(message_id);
CREATE INDEX IF NOT EXISTS idx_chat_comments_parent_id ON chat_comments(parent_id);
CREATE INDEX IF NOT EXISTS idx_chat_comments_author_id ON chat_comments(author_id);
CREATE INDEX IF NOT EXISTS idx_chat_comments_created_at ON chat_comments(created_at);
)
"""
)
op.execute(
"CREATE INDEX IF NOT EXISTS idx_chat_comments_message_id ON chat_comments(message_id)"
)
op.execute(
"CREATE INDEX IF NOT EXISTS idx_chat_comments_parent_id ON chat_comments(parent_id)"
)
op.execute(
"CREATE INDEX IF NOT EXISTS idx_chat_comments_author_id ON chat_comments(author_id)"
)
op.execute(
"CREATE INDEX IF NOT EXISTS idx_chat_comments_created_at ON chat_comments(created_at)"
)
def downgrade() -> None:

View file

@ -25,15 +25,15 @@ def upgrade() -> None:
read BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE (comment_id, mentioned_user_id)
);
-- Create indexes
CREATE INDEX IF NOT EXISTS idx_chat_comment_mentions_comment_id
ON chat_comment_mentions(comment_id);
CREATE INDEX IF NOT EXISTS idx_chat_comment_mentions_user_unread
ON chat_comment_mentions(mentioned_user_id) WHERE read = FALSE;
)
"""
)
op.execute(
"CREATE INDEX IF NOT EXISTS idx_chat_comment_mentions_comment_id ON chat_comment_mentions(comment_id)"
)
op.execute(
"CREATE INDEX IF NOT EXISTS idx_chat_comment_mentions_user_unread ON chat_comment_mentions(mentioned_user_id) WHERE read = FALSE"
)
def downgrade() -> None: