Portal: move Schedule to per-License-Key with daily/weekly and Block.day
Adds Schedule.licenseKeyId (unique, nullable) and Schedule.type, makes the legacy userId optional/non-unique, adds Block.day and flips Block dynamicAudio default to true. The migration backfills each existing per-user schedule onto that account's oldest License Key as a daily schedule, preserves unmappable schedules (licenseKeyId NULL) with a NOTICE, and is reversible. Tested up/down against a scratch schema.
This commit is contained in:
@@ -2069,7 +2069,9 @@ export type AuditLogScalarFieldEnum = (typeof AuditLogScalarFieldEnum)[keyof typ
|
||||
|
||||
export const ScheduleScalarFieldEnum = {
|
||||
id: 'id',
|
||||
licenseKeyId: 'licenseKeyId',
|
||||
userId: 'userId',
|
||||
type: 'type',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
@@ -2080,6 +2082,7 @@ export type ScheduleScalarFieldEnum = (typeof ScheduleScalarFieldEnum)[keyof typ
|
||||
export const BlockScalarFieldEnum = {
|
||||
id: 'id',
|
||||
scheduleId: 'scheduleId',
|
||||
day: 'day',
|
||||
startMinutes: 'startMinutes',
|
||||
endMinutes: 'endMinutes',
|
||||
dynamicAudio: 'dynamicAudio',
|
||||
|
||||
Reference in New Issue
Block a user