chris 2c78112a4f Initial commit: E-Invite, a self-hosted Evite-lite
Docker-ready Next.js + Prisma/Postgres e-invitation app: themed invite
pages, RSVP, comments, share links, email + SMS invites with
reply-to-RSVP-by-text, co-hosts, photo dropbox, and browser push
notifications.
2026-07-11 10:11:12 -04:00

25 lines
956 B
SQL

-- AlterTable
ALTER TABLE "GuestInvite" ADD COLUMN "phone" TEXT,
ADD COLUMN "smsSent" BOOLEAN NOT NULL DEFAULT false,
ALTER COLUMN "email" DROP NOT NULL;
-- AlterTable
ALTER TABLE "Rsvp" ADD COLUMN "guestPhone" TEXT,
ALTER COLUMN "guestEmail" DROP NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX "GuestInvite_eventId_phone_key" ON "GuestInvite"("eventId", "phone");
-- CreateIndex
CREATE UNIQUE INDEX "Rsvp_eventId_guestPhone_key" ON "Rsvp"("eventId", "guestPhone");
-- CheckConstraint: not expressible in Prisma's schema language, so added by
-- hand. Every existing row already has a non-null guestEmail/email (the
-- prior schema required it), so no backfill is needed before adding these.
ALTER TABLE "Rsvp" ADD CONSTRAINT "rsvp_guest_contact_check"
CHECK ("guestEmail" IS NOT NULL OR "guestPhone" IS NOT NULL);
ALTER TABLE "GuestInvite" ADD CONSTRAINT "guestinvite_contact_check"
CHECK ("email" IS NOT NULL OR "phone" IS NOT NULL);