- Drag-and-drop widget arrangement (main two-column zone + sidebar) with per-widget span resize, persisted to Users.preferences.dashboard.layout via saveDashboardLayout (migration included) - New personal widgets: Wallet, Open Negotiations, My Tickets (View all), Recent Notifications (per-row mark as read) - Widgets that are empty or not visible to the viewer are omitted so they never render as empty drag targets - Registers both pending migrations and regenerates payload types/schema
11 lines
437 B
TypeScript
11 lines
437 B
TypeScript
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'
|
|
|
|
export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
|
|
await db.execute(sql`
|
|
ALTER TABLE "users" ADD COLUMN "preferences_dashboard_layout" jsonb;`)
|
|
}
|
|
|
|
export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
|
|
await db.execute(sql`
|
|
ALTER TABLE "users" DROP COLUMN "preferences_dashboard_layout";`)
|
|
}
|