20 lines
806 B
MySQL
20 lines
806 B
MySQL
|
-- CreateTable
|
||
|
CREATE TABLE "ComicBubble" (
|
||
|
"comicId" INTEGER NOT NULL,
|
||
|
"pageId" INTEGER NOT NULL,
|
||
|
"idx" INTEGER NOT NULL,
|
||
|
"characterId" INTEGER NOT NULL,
|
||
|
"areaX" INTEGER NOT NULL,
|
||
|
"areaY" INTEGER NOT NULL,
|
||
|
"areaWidth" INTEGER NOT NULL,
|
||
|
"areaHeight" INTEGER NOT NULL,
|
||
|
"content" TEXT NOT NULL,
|
||
|
|
||
|
PRIMARY KEY ("comicId", "pageId", "idx"),
|
||
|
CONSTRAINT "ComicBubble_comicId_pageId_fkey" FOREIGN KEY ("comicId", "pageId") REFERENCES "ComicPage" ("comicId", "id") ON DELETE RESTRICT ON UPDATE CASCADE,
|
||
|
CONSTRAINT "ComicBubble_characterId_fkey" FOREIGN KEY ("characterId") REFERENCES "ComicCharacter" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||
|
);
|
||
|
|
||
|
-- CreateIndex
|
||
|
CREATE UNIQUE INDEX "ComicBubble_comicId_pageId_idx_key" ON "ComicBubble"("comicId", "pageId", "idx");
|