Files
RustBox/migrations/sqlite/V003__add_date_epoch.sql
T
Mateusz Gruszczyński 425ea7449b
RustBox CI / rustbox (push) Canceled after 0s
v0.1.0
2026-10-30 17:22:17 +01:00

7 lines
316 B
SQL

-- Add a sortable integer timestamp column for proper date ordering.
ALTER TABLE messages ADD COLUMN date_epoch INTEGER NOT NULL DEFAULT 0;
-- Rebuild index to use the new column for sorting.
DROP INDEX IF EXISTS idx_messages_folder_date;
CREATE INDEX idx_messages_folder_date ON messages(folder, date_epoch DESC);