-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Pub" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "title" TEXT NOT NULL,
    "link" TEXT NOT NULL,
    "query_after_days" INTEGER NOT NULL,
    "deleted" INTEGER NOT NULL DEFAULT 0
);
INSERT INTO "new_Pub" ("deleted", "id", "link", "query_after_days", "title") SELECT "deleted", "id", "link", "query_after_days", "title" FROM "Pub";
DROP TABLE "Pub";
ALTER TABLE "new_Pub" RENAME TO "Pub";
CREATE TABLE "new_Story" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "word_count" INTEGER NOT NULL,
    "title" TEXT NOT NULL,
    "deleted" INTEGER NOT NULL DEFAULT 0
);
INSERT INTO "new_Story" ("deleted", "id", "title", "word_count") SELECT "deleted", "id", "title", "word_count" FROM "Story";
DROP TABLE "Story";
ALTER TABLE "new_Story" RENAME TO "Story";
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;
