text: -- CreateTable
  CREATE TABLE "Book" (
      "id" TEXT NOT NULL,
      "book_type" TEXT,
      "title" TEXT NOT NULL,
      "sub_title" TEXT,
      "description" TEXT,
      "tags" JSONB,
      "author" TEXT NOT NULL,
      "translator" TEXT,
      "publisher" TEXT,
      "isbn" TEXT,
      "rating" TEXT,
      "cover_img_url" TEXT,
      "sub_img_url" TEXT,
      "published_at" TIMESTAMP(3) NOT NULL,
      "viewed" INTEGER,
      "chapters" INTEGER,
      "comments" INTEGER,
      "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated_at" TIMESTAMP(3) NOT NULL,
      "book_status" TEXT,
  
      CONSTRAINT "Book_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "BookType" (
      "id" SERIAL NOT NULL,
      "type" TEXT NOT NULL,
      "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated_at" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "BookType_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "BookStatus" (
      "id" SERIAL NOT NULL,
      "status" TEXT NOT NULL,
      "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated_at" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "BookStatus_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "Category" (
      "id" SERIAL NOT NULL,
      "category" TEXT NOT NULL,
      "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated_at" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "Category_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "File" (
      "id" TEXT NOT NULL,
      "file_type_id" TEXT NOT NULL,
      "name" TEXT NOT NULL,
      "url" TEXT NOT NULL,
      "size" INTEGER NOT NULL,
      "mime_type" TEXT NOT NULL,
      "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated_at" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "File_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "FileType" (
      "id" TEXT NOT NULL,
      "type" TEXT NOT NULL,
      "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated_at" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "FileType_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "Rating" (
      "id" SERIAL NOT NULL,
      "rating" TEXT NOT NULL,
      "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated_at" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "Rating_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "_BookToCategory" (
      "A" TEXT NOT NULL,
      "B" INTEGER NOT NULL
  );
  
  -- CreateIndex
  CREATE UNIQUE INDEX "Book_title_key" ON "Book"("title");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "BookType_type_key" ON "BookType"("type");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "BookStatus_status_key" ON "BookStatus"("status");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "Category_category_key" ON "Category"("category");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "FileType_type_key" ON "FileType"("type");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "Rating_rating_key" ON "Rating"("rating");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "_BookToCategory_AB_unique" ON "_BookToCategory"("A", "B");
  
  -- CreateIndex
  CREATE INDEX "_BookToCategory_B_index" ON "_BookToCategory"("B");
  
  -- AddForeignKey
  ALTER TABLE "Book" ADD CONSTRAINT "Book_book_type_fkey" FOREIGN KEY ("book_type") REFERENCES "BookType"("type") ON DELETE SET NULL ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "Book" ADD CONSTRAINT "Book_rating_fkey" FOREIGN KEY ("rating") REFERENCES "Rating"("rating") ON DELETE SET NULL ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "Book" ADD CONSTRAINT "Book_book_status_fkey" FOREIGN KEY ("book_status") REFERENCES "BookStatus"("status") ON DELETE SET NULL ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "File" ADD CONSTRAINT "File_file_type_id_fkey" FOREIGN KEY ("file_type_id") REFERENCES "FileType"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "_BookToCategory" ADD FOREIGN KEY ("A") REFERENCES "Book"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "_BookToCategory" ADD FOREIGN KEY ("B") REFERENCES "Category"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  