🔥 Remove deprecated event model (#1775)

This commit is contained in:
Luke Vella 2025-06-14 12:39:02 +02:00 committed by GitHub
parent b1b76b4bec
commit 37b7ed5e19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 85 additions and 248 deletions

View file

@ -0,0 +1,14 @@
/*
Warnings:
- You are about to drop the `events` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "events" DROP CONSTRAINT "events_user_id_fkey";
-- DropForeignKey
ALTER TABLE "polls" DROP CONSTRAINT "polls_event_id_fkey";
-- DropTable
DROP TABLE "events";

View file

@ -1,23 +1,3 @@
/**
* Events are created when a user creates a new event
* @deprecated
*/
model Event {
id String @id @default(cuid())
userId String @map("user_id")
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
optionId String @map("option_id")
title String
start DateTime @db.Timestamp(0)
duration Int @default(0) @map("duration_minutes")
createdAt DateTime @default(now()) @map("created_at")
poll Poll?
@@index([userId], type: Hash)
@@map("events")
}
enum ScheduledEventStatus {
confirmed
canceled

View file

@ -39,7 +39,6 @@ model Poll {
requireParticipantEmail Boolean @default(false) @map("require_participant_email")
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
event Event? @relation(fields: [eventId], references: [id], onDelete: SetNull)
scheduledEvent ScheduledEvent? @relation(fields: [scheduledEventId], references: [id], onDelete: SetNull)
options Option[]
participants Participant[]

View file

@ -53,7 +53,6 @@ model User {
comments Comment[]
polls Poll[]
watcher Watcher[]
events Event[]
accounts Account[]
participants Participant[]
paymentMethods PaymentMethod[]