-- Febe, schema version 2: «Cosa scaricare prima» (tappa D1, issue #59; spec §7.2, §4.4, §8.3). -- Run by the migration runner inside a transaction; PRAGMA user_version is set by the runner. -- Only columns and indexes are added: no behaviour changes for the data already stored. -- The order of «Cosa scaricare prima» of the account: the Italian names of the five kinds, comma separated -- («storie,evidenza,post,reel,taggati»). NULL: «Come le impostazioni generali» (setting scaricamento.ordine). ALTER TABLE account ADD COLUMN download_order TEXT; -- A post that Febe knows to be a reel (found in the Reel tab, or marked so in the response): it counts as a reel in -- the queue of the files. 0 for every post stored before, which Febe cannot tell apart without asking the site again. ALTER TABLE entry ADD COLUMN is_reel INTEGER NOT NULL DEFAULT 0 CHECK (is_reel IN (0, 1)); -- What a recipe saved, for the thumbnails of the history of the Dashboard (spec §7.9): the entries discovered in the -- few minutes of the recipe, of one account or of all (the Giro dei seguiti), read by range whatever the library's size. CREATE INDEX ix_entry_discovered ON entry (discovered_at); -- «Tutte le foto» (spec §4.6): the files of an entry that are in the library, and of which kind, read from the index -- alone, so the counts of the days and the total of the files stay within the times of the scale test (200,000 entries). CREATE INDEX ix_media_entry_files ON media (entry_id, state, kind);