🔥 Remove closed column (#1656)

This commit is contained in:
Luke Vella 2025-04-02 15:02:52 +01:00 committed by GitHub
parent 47d96f7bee
commit 53a48a0511
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 9 deletions

View file

@ -29,7 +29,7 @@ export const usePermissions = () => {
const { user, ownsObject } = useUser(); const { user, ownsObject } = useUser();
const role = useRole(); const role = useRole();
const { participants } = useParticipants(); const { participants } = useParticipants();
const isClosed = poll.closed === true || poll.event !== null; const isClosed = poll.event !== null;
return { return {
isUser: (userId: string) => userId === user.id || userId === context.userId, isUser: (userId: string) => userId === user.id || userId === context.userId,
canAddNewParticipant: !isClosed, canAddNewParticipant: !isClosed,

View file

@ -17,7 +17,6 @@ export type GetPollApiResponse = {
adminUrlId: string; adminUrlId: string;
status: PollStatus; status: PollStatus;
participantUrlId: string; participantUrlId: string;
closed: boolean;
createdAt: Date; createdAt: Date;
deleted: boolean; deleted: boolean;
}; };

View file

@ -265,7 +265,6 @@ export const polls = router({
description: z.string().optional(), description: z.string().optional(),
optionsToDelete: z.string().array().optional(), optionsToDelete: z.string().array().optional(),
optionsToAdd: z.string().array().optional(), optionsToAdd: z.string().array().optional(),
closed: z.boolean().optional(),
hideParticipants: z.boolean().optional(), hideParticipants: z.boolean().optional(),
disableComments: z.boolean().optional(), disableComments: z.boolean().optional(),
hideScores: z.boolean().optional(), hideScores: z.boolean().optional(),
@ -344,7 +343,6 @@ export const polls = router({
location: input.location, location: input.location,
description: input.description, description: input.description,
timeZone: input.timeZone, timeZone: input.timeZone,
closed: input.closed,
hideScores: input.hideScores, hideScores: input.hideScores,
hideParticipants: input.hideParticipants, hideParticipants: input.hideParticipants,
disableComments: input.disableComments, disableComments: input.disableComments,
@ -431,7 +429,6 @@ export const polls = router({
createdAt: true, createdAt: true,
adminUrlId: true, adminUrlId: true,
participantUrlId: true, participantUrlId: true,
closed: true,
status: true, status: true,
hideParticipants: true, hideParticipants: true,
disableComments: true, disableComments: true,
@ -770,7 +767,6 @@ export const polls = router({
delete: true, delete: true,
}, },
status: "live", status: "live",
closed: false, // @deprecated
}, },
}), }),
]); ]);
@ -787,7 +783,6 @@ export const polls = router({
id: input.pollId, id: input.pollId,
}, },
data: { data: {
closed: true, // TODO (Luke Vella) [2023-12-05]: Remove this
status: "paused", status: "paused",
}, },
}); });
@ -865,7 +860,6 @@ export const polls = router({
id: input.pollId, id: input.pollId,
}, },
data: { data: {
closed: false,
status: "live", status: "live",
}, },
}); });

View file

@ -0,0 +1,8 @@
/*
Warnings:
- You are about to drop the column `closed` on the `polls` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "polls" DROP COLUMN "closed";

View file

@ -148,7 +148,6 @@ model Poll {
userId String? @map("user_id") userId String? @map("user_id")
guestId String? @map("guest_id") guestId String? @map("guest_id")
timeZone String? @map("time_zone") timeZone String? @map("time_zone")
closed Boolean @default(false) // @deprecated
status PollStatus @default(live) status PollStatus @default(live)
deleted Boolean @default(false) deleted Boolean @default(false)
deletedAt DateTime? @map("deleted_at") deletedAt DateTime? @map("deleted_at")