23 lines
581 B
SQL
23 lines
581 B
SQL
/*
|
|
Warnings:
|
|
|
|
- You are about to drop the column `image` on the `Trip` table. All the data in the column will be lost.
|
|
|
|
*/
|
|
-- AlterTable
|
|
ALTER TABLE "Trip" DROP COLUMN "image";
|
|
|
|
-- CreateTable
|
|
CREATE TABLE "TripImage" (
|
|
"id" TEXT NOT NULL,
|
|
"url" TEXT NOT NULL,
|
|
"caption" TEXT,
|
|
"order" INTEGER NOT NULL DEFAULT 0,
|
|
"tripId" TEXT NOT NULL,
|
|
|
|
CONSTRAINT "TripImage_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "TripImage" ADD CONSTRAINT "TripImage_tripId_fkey" FOREIGN KEY ("tripId") REFERENCES "Trip"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|