This repository has been archived on 2026-04-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
core/server/database/migrations/021_export.sql
Jeffrey Smith d16bb93177 Changeset 0.34.0 (#208)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
2026-03-20 00:02:37 +00:00

19 lines
666 B
SQL

-- ==========================================
-- Chat Switchboard — 021 Data Portability
-- ==========================================
-- v0.34.0: Indexes for data export and GDPR operations.
-- ==========================================
-- Partial index for batch message export (only non-deleted)
CREATE INDEX IF NOT EXISTS idx_messages_channel_active
ON messages (channel_id, created_at)
WHERE deleted_at IS NULL;
-- Index for user-scoped channel listing (export)
CREATE INDEX IF NOT EXISTS idx_channels_user_id
ON channels (user_id);
-- Index for file lookup by user (export)
CREATE INDEX IF NOT EXISTS idx_files_user_id
ON files (user_id);