Files
wedding-planner/prisma/migrations/20250723173825_updated_location_name_to_venue/migration.sql
2025-07-24 09:42:57 -04:00

35 lines
959 B
SQL

/*
Warnings:
- You are about to drop the column `locationid` on the `Event` table. All the data in the column will be lost.
- You are about to drop the `Location` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "Event" DROP CONSTRAINT "Event_locationid_fkey";
-- AlterTable
ALTER TABLE "Event" DROP COLUMN "locationid",
ADD COLUMN "venueId" TEXT;
-- DropTable
DROP TABLE "Location";
-- CreateTable
CREATE TABLE "Venue" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"address" TEXT NOT NULL,
"city" TEXT NOT NULL,
"state" TEXT NOT NULL,
"postalCode" TEXT NOT NULL,
"country" TEXT NOT NULL DEFAULT 'United States',
"phone" TEXT,
"email" TEXT,
CONSTRAINT "Venue_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Event" ADD CONSTRAINT "Event_venueId_fkey" FOREIGN KEY ("venueId") REFERENCES "Venue"("id") ON DELETE SET NULL ON UPDATE CASCADE;