venues and ui changes
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
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;
|
||||
@@ -30,8 +30,8 @@ model Event {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
date DateTime?
|
||||
location Location? @relation(fields: [locationid], references: [id])
|
||||
locationid String?
|
||||
venue Venue? @relation(fields: [venueId], references: [id])
|
||||
venueId String?
|
||||
creator User @relation("EventCreator", fields: [creatorId], references: [id])
|
||||
creatorId String
|
||||
guests Guest[]
|
||||
@@ -43,7 +43,7 @@ model Event {
|
||||
FileUpload FileUpload[]
|
||||
}
|
||||
|
||||
model Location {
|
||||
model Venue {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
address String
|
||||
@@ -53,17 +53,19 @@ model Location {
|
||||
country String @default("United States")
|
||||
phone String?
|
||||
email String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
Event Event[]
|
||||
}
|
||||
|
||||
model Guest {
|
||||
id String @id @default(cuid())
|
||||
event Event @relation(fields: [eventId], references: [id])
|
||||
eventId String
|
||||
name String
|
||||
email String?
|
||||
rsvp RsvpStatus @default(PENDING)
|
||||
id String @id @default(cuid())
|
||||
event Event @relation(fields: [eventId], references: [id])
|
||||
eventId String
|
||||
name String
|
||||
email String?
|
||||
rsvp RsvpStatus @default(PENDING)
|
||||
// attended RsvpStatus @default(PENDING)
|
||||
}
|
||||
|
||||
enum RsvpStatus {
|
||||
|
||||
Reference in New Issue
Block a user