Skip to content

Commit

Permalink
feat: implement nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
oae committed Oct 15, 2022
1 parent 787bbba commit 6e9a6a4
Show file tree
Hide file tree
Showing 7 changed files with 317 additions and 158 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@trpc/server": "^10.0.0-proxy-beta.13",
"bullmq": "^2.1.3",
"chokidar": "^3.5.3",
"dayjs": "^1.11.5",
"execa": "5.1.1",
"express": "^4.18.1",
"json-diff": "^0.9.0",
Expand All @@ -63,6 +64,7 @@
"node-telegram-bot-api": "^0.59.0",
"pino": "^8.6.1",
"pino-pretty": "^9.1.0",
"pretty-bytes": "5.6.0",
"prop-types": "^15.8.1",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
39 changes: 39 additions & 0 deletions prisma/migrations/20221015165819_add_dates/migration.sql
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;
21 changes: 12 additions & 9 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ datasource db {
}

model Library {
id Int @id @default(autoincrement())
path String @unique
mangas Manga[]
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
path String @unique
mangas Manga[]
}

model Manga {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
title String @unique
cover String
interval String
Expand All @@ -29,10 +31,11 @@ model Manga {
}

model Chapter {
id Int @id @default(autoincrement())
index Int
fileName String
size Int
manga Manga @relation(fields: [mangaId], references: [id], onDelete: Cascade)
mangaId Int
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
index Int
fileName String
size Int
manga Manga @relation(fields: [mangaId], references: [id], onDelete: Cascade)
mangaId Int
}
Loading

0 comments on commit 6e9a6a4

Please sign in to comment.