diff --git a/Frameworks/ArticlesDatabase/ArticlesDatabase.swift b/Frameworks/ArticlesDatabase/ArticlesDatabase.swift index bffd9f08e..d369dcb7c 100644 --- a/Frameworks/ArticlesDatabase/ArticlesDatabase.swift +++ b/Frameworks/ArticlesDatabase/ArticlesDatabase.swift @@ -35,7 +35,7 @@ public final class ArticlesDatabase { let createStatements = try! NSString(contentsOfFile: createStatementsPath, encoding: String.Encoding.utf8.rawValue) queue.createTables(usingStatements: createStatements as String) queue.update { (database) in - database.executeStatements("DROP TABLE if EXISTS tags;DROP INDEX if EXISTS tags_tagName_index;") + database.executeStatements("DROP TABLE if EXISTS tags;DROP INDEX if EXISTS tags_tagName_index;DROP INDEX if EXISTS articles_feedID_index;DROP INDEX if EXISTS statuses_read_index;") } queue.vacuumIfNeeded() } diff --git a/Frameworks/ArticlesDatabase/CreateStatements.sql b/Frameworks/ArticlesDatabase/CreateStatements.sql index 713fc24a3..68604b850 100644 --- a/Frameworks/ArticlesDatabase/CreateStatements.sql +++ b/Frameworks/ArticlesDatabase/CreateStatements.sql @@ -8,8 +8,6 @@ CREATE TABLE if not EXISTS authorsLookup (authorID TEXT NOT NULL, articleID TEXT CREATE TABLE if not EXISTS attachments(attachmentID TEXT NOT NULL PRIMARY KEY, url TEXT NOT NULL, mimeType TEXT, title TEXT, sizeInBytes INTEGER, durationInSeconds INTEGER); CREATE TABLE if not EXISTS attachmentsLookup(attachmentID TEXT NOT NULL, articleID TEXT NOT NULL, PRIMARY KEY(attachmentID, articleID)); -CREATE INDEX if not EXISTS articles_feedID_index on articles (feedID); +CREATE INDEX if not EXISTS articles_feedID_datePublished_articleID on articles (feedID, datePublished, articleID); -CREATE INDEX if not EXISTS statuses_read_index on statuses (read); CREATE INDEX if not EXISTS statuses_starred_index on statuses (starred); -