-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
317 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
-- RedefineTables | ||
PRAGMA foreign_keys=OFF; | ||
CREATE TABLE "new_Chapter" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"index" INTEGER NOT NULL, | ||
"fileName" TEXT NOT NULL, | ||
"size" INTEGER NOT NULL, | ||
"mangaId" INTEGER NOT NULL, | ||
CONSTRAINT "Chapter_mangaId_fkey" FOREIGN KEY ("mangaId") REFERENCES "Manga" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
INSERT INTO "new_Chapter" ("fileName", "id", "index", "mangaId", "size") SELECT "fileName", "id", "index", "mangaId", "size" FROM "Chapter"; | ||
DROP TABLE "Chapter"; | ||
ALTER TABLE "new_Chapter" RENAME TO "Chapter"; | ||
CREATE TABLE "new_Manga" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"title" TEXT NOT NULL, | ||
"cover" TEXT NOT NULL, | ||
"interval" TEXT NOT NULL, | ||
"source" TEXT NOT NULL, | ||
"libraryId" INTEGER NOT NULL, | ||
CONSTRAINT "Manga_libraryId_fkey" FOREIGN KEY ("libraryId") REFERENCES "Library" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
INSERT INTO "new_Manga" ("cover", "id", "interval", "libraryId", "source", "title") SELECT "cover", "id", "interval", "libraryId", "source", "title" FROM "Manga"; | ||
DROP TABLE "Manga"; | ||
ALTER TABLE "new_Manga" RENAME TO "Manga"; | ||
CREATE UNIQUE INDEX "Manga_title_key" ON "Manga"("title"); | ||
CREATE TABLE "new_Library" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"path" TEXT NOT NULL | ||
); | ||
INSERT INTO "new_Library" ("id", "path") SELECT "id", "path" FROM "Library"; | ||
DROP TABLE "Library"; | ||
ALTER TABLE "new_Library" RENAME TO "Library"; | ||
CREATE UNIQUE INDEX "Library_path_key" ON "Library"("path"); | ||
PRAGMA foreign_key_check; | ||
PRAGMA foreign_keys=ON; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.