-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
13 changed files
with
190 additions
and
105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
version: '3' | ||
|
||
volumes: | ||
db: | ||
|
||
|
||
services: | ||
redis: | ||
image: redis:7-alpine | ||
ports: | ||
- 6379:6379 | ||
db: | ||
image: postgres:alpine | ||
restart: unless-stopped | ||
healthcheck: | ||
test: [ "CMD-SHELL", "pg_isready -U kaizoku" ] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
env_file: | ||
- .env | ||
environment: | ||
POSTGRES_USER: ${DATABASE_USER} | ||
POSTGRES_DB: ${DATABASE_SCHEMA} | ||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD} | ||
volumes: | ||
- db:/var/lib/postgresql/data | ||
ports: | ||
- "${DATABASE_PORT}:5432" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,70 @@ | ||
-- CreateTable | ||
CREATE TABLE "Library" ( | ||
"id" SERIAL NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"path" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Library_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Manga" ( | ||
"id" SERIAL NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"title" TEXT NOT NULL, | ||
"interval" TEXT NOT NULL, | ||
"source" TEXT NOT NULL, | ||
"libraryId" INTEGER NOT NULL, | ||
"metadataId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Manga_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Chapter" ( | ||
"id" SERIAL NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"index" INTEGER NOT NULL, | ||
"fileName" TEXT NOT NULL, | ||
"size" INTEGER NOT NULL, | ||
"mangaId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Chapter_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Metadata" ( | ||
"id" SERIAL NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"genres" TEXT[] DEFAULT ARRAY[]::TEXT[], | ||
"summary" TEXT NOT NULL DEFAULT '', | ||
"authors" TEXT[] DEFAULT ARRAY[]::TEXT[], | ||
"cover" TEXT NOT NULL DEFAULT '/cover-not-found.jpg', | ||
"tags" TEXT[] DEFAULT ARRAY[]::TEXT[], | ||
"characters" TEXT[] DEFAULT ARRAY[]::TEXT[], | ||
"status" TEXT NOT NULL DEFAULT 'UNKNOWN', | ||
"startDate" TIMESTAMP(3), | ||
"endDate" TIMESTAMP(3), | ||
"synonyms" TEXT[] DEFAULT ARRAY[]::TEXT[], | ||
"urls" TEXT[] DEFAULT ARRAY[]::TEXT[], | ||
|
||
CONSTRAINT "Metadata_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Library_path_key" ON "Library"("path"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Manga_title_key" ON "Manga"("title"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Manga_metadataId_key" ON "Manga"("metadataId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Manga" ADD CONSTRAINT "Manga_libraryId_fkey" FOREIGN KEY ("libraryId") REFERENCES "Library"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Manga" ADD CONSTRAINT "Manga_metadataId_fkey" FOREIGN KEY ("metadataId") REFERENCES "Metadata"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Chapter" ADD CONSTRAINT "Chapter_mangaId_fkey" FOREIGN KEY ("mangaId") REFERENCES "Manga"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "sqlite" | ||
provider = "postgresql" |
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
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
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
Oops, something went wrong.