Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🗑️ Drop the participant soft-delete columns (#3194)

Luke Vellaf79dde98169e
diff --git a/apps/landing/src/lib/data.ts b/apps/landing/src/lib/data.ts
index b10ea2193..9f79b8225 100644
--- a/apps/landing/src/lib/data.ts
+++ b/apps/landing/src/lib/data.ts
@@ -14,7 +14,6 @@ export const getMonthlyPollCount = async () => {
participants: {
some: {
createdAt: { gte: new Date(Date.now() - THIRTY_DAYS_MS) },
- deleted: false,
},
},
},
@@ -27,7 +26,6 @@ export const getMonthlyVoterCount = async () => {
return prisma.participant.count({
where: {
createdAt: { gte: new Date(Date.now() - THIRTY_DAYS_MS) },
- deleted: false,
},
});
};
diff --git a/apps/web/src/features/poll/data.ts b/apps/web/src/features/poll/data.ts
index 8238a338f..ee9c311b4 100644
--- a/apps/web/src/features/poll/data.ts
+++ b/apps/web/src/features/poll/data.ts
@@ -296,9 +296,6 @@ export const getPolls = async ({
},
},
participants: {
- where: {
- deletedAt: null,
- },
select: {
id: true,
name: true,
diff --git a/packages/database/prisma/migrations/20260906120000_drop_participant_soft_delete_columns/migration.sql b/packages/database/prisma/migrations/20260906120000_drop_participant_soft_delete_columns/migration.sql
new file mode 100644
index 000000000..0bfb62089
--- /dev/null
+++ b/packages/database/prisma/migrations/20260906120000_drop_participant_soft_delete_columns/migration.sql
@@ -0,0 +1,16 @@
+-- Response deletion became a hard delete in #3191, the backlog was purged in
+-- #3192, and the last read that filtered on these columns was removed in
+-- #3193. Nothing writes them and nothing reads them, so they come out.
+--
+-- Ordering matters and is what makes this safe. On cloud the filter removal
+-- was deployed before this migration ships, so no running instance queries
+-- the dropped columns. On self hosted, migrations run in order at container
+-- start before the server boots, so an instance upgrading across all four
+-- changes applies the purge and this drop against code that already stopped
+-- referencing them.
+--
+-- `response_deleted` PollActivity rows are the historical record of deleted
+-- responses and are untouched: they hold their own name and vote snapshot and
+-- reference the participant by a soft id with no FK.
+ALTER TABLE "participants" DROP COLUMN "deleted",
+DROP COLUMN "deleted_at";
diff --git a/packages/database/prisma/models/poll.prisma b/packages/database/prisma/models/poll.prisma
index 3457a106e..8792154e1 100644
--- a/packages/database/prisma/models/poll.prisma
+++ b/packages/database/prisma/models/poll.prisma
@@ -81,8 +81,6 @@ model Participant {
timeZone String? @map("time_zone")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime? @updatedAt @map("updated_at")
- deleted Boolean @default(false)
- deletedAt DateTime? @map("deleted_at")
votes Vote[]
invite PollInvite?