Files
silo-server/migrations/125_collection_smart_count_cache.up.sql
T

7 lines
274 B
SQL

ALTER TABLE library_collections
ADD COLUMN item_count_cached INTEGER NOT NULL DEFAULT 0,
ADD COLUMN item_count_cached_at TIMESTAMPTZ;
CREATE INDEX idx_library_collections_smart_count_sort
ON library_collections (collection_type, item_count_cached DESC, title);