From bf005280c7b15536aafcec38c28616ba9562e755 Mon Sep 17 00:00:00 2001 From: maxitect Date: Fri, 13 Nov 2026 22:53:59 +0000 Subject: [PATCH 1/4] feat(calendar): open to the public on 1 December, with Visible as the off switch --- src/globals/CalendarSettings.ts | 4 +- src/lib/calendar/doors.ts | 7 +- src/lib/calendar/settings.ts | 2 +- ...20261113_225308_visible_on_by_default.json | 2950 +++++++++++++++++ .../20261113_225308_visible_on_by_default.ts | 13 + src/migrations/index.ts | 8 +- src/payload-types.ts | 2 +- 7 files changed, 2979 insertions(+), 7 deletions(-) create mode 100644 src/migrations/20261113_225308_visible_on_by_default.json create mode 100644 src/migrations/20261113_225308_visible_on_by_default.ts diff --git a/src/globals/CalendarSettings.ts b/src/globals/CalendarSettings.ts index a8a9670..bd37fed 100644 --- a/src/globals/CalendarSettings.ts +++ b/src/globals/CalendarSettings.ts @@ -80,10 +80,10 @@ export const CalendarSettings: GlobalConfig = { { name: "visible", type: "checkbox", - defaultValue: false, + defaultValue: true, admin: { description: - "Off: visitors get a holding page. Signed-in members still see the preview.", + "The calendar opens to visitors by itself on 1 December. Untick to take it down (visitors get a holding page); tick again to bring it back. Signed-in members always see the preview.", }, }, { diff --git a/src/lib/calendar/doors.ts b/src/lib/calendar/doors.ts index 66e8561..7519b5e 100644 --- a/src/lib/calendar/doors.ts +++ b/src/lib/calendar/doors.ts @@ -51,11 +51,14 @@ export async function findDoors( }); } -/** The settings and the open doors as a visitor, who sees nothing when the calendar is hidden. */ +/** The settings and the open doors as a visitor, who sees nothing before 1 December (midnight Paris) or when the calendar is switched off. */ export async function getPublicState(now = new Date()) { const settings = await getCalendarSettings(); const { today, ended } = getCalendarDay(now, settings); + const { today: started } = getCalendarDay(now, { ...settings, opensAtHour: 0 }); const open = - settings.visible && !(ended && settings.afterEnd === "holding"); + settings.visible && + started > 0 && + !(ended && settings.afterEnd === "holding"); return { settings, today, open }; } diff --git a/src/lib/calendar/settings.ts b/src/lib/calendar/settings.ts index 9ed28e2..430f607 100644 --- a/src/lib/calendar/settings.ts +++ b/src/lib/calendar/settings.ts @@ -78,7 +78,7 @@ export async function getCalendarSettings(): Promise { ); return { - visible: en.behaviour?.visible ?? false, + visible: en.behaviour?.visible ?? true, year: en.behaviour?.year ?? defaultYear, opensAtHour: en.behaviour?.opensAtHour ?? defaultHour, afterEnd: en.behaviour?.afterEnd ?? "open", diff --git a/src/migrations/20261113_225308_visible_on_by_default.json b/src/migrations/20261113_225308_visible_on_by_default.json new file mode 100644 index 0000000..a3a0dd1 --- /dev/null +++ b/src/migrations/20261113_225308_visible_on_by_default.json @@ -0,0 +1,2950 @@ +{ + "version": "7", + "dialect": "postgresql", + "tables": { + "public.users_sessions": { + "name": "users_sessions", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "users_sessions_order_idx": { + "name": "users_sessions_order_idx", + "columns": [ + { + "expression": "_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "users_sessions_parent_id_idx": { + "name": "users_sessions_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "users_sessions_parent_id_fk": { + "name": "users_sessions_parent_id_fk", + "tableFrom": "users_sessions", + "tableTo": "users", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "reset_password_token": { + "name": "reset_password_token", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "reset_password_expiration": { + "name": "reset_password_expiration", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "salt": { + "name": "salt", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "hash": { + "name": "hash", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "reset_password_requested_at": { + "name": "reset_password_requested_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "login_attempts": { + "name": "login_attempts", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "lock_until": { + "name": "lock_until", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "users_updated_at_idx": { + "name": "users_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "users_created_at_idx": { + "name": "users_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "users_email_idx": { + "name": "users_email_idx", + "columns": [ + { + "expression": "email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.media": { + "name": "media", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_objectkey": { + "name": "_objectkey", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "thumbnail_u_r_l": { + "name": "thumbnail_u_r_l", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "filename": { + "name": "filename", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "mime_type": { + "name": "mime_type", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "filesize": { + "name": "filesize", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "width": { + "name": "width", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "height": { + "name": "height", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "focal_x": { + "name": "focal_x", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "focal_y": { + "name": "focal_y", + "type": "numeric", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "media_updated_at_idx": { + "name": "media_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "media_created_at_idx": { + "name": "media_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "media_filename_idx": { + "name": "media_filename_idx", + "columns": [ + { + "expression": "filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.media_locales": { + "name": "media_locales", + "schema": "", + "columns": { + "alt": { + "name": "alt", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_locale": { + "name": "_locale", + "type": "_locales", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "media_locales_locale_parent_id_unique": { + "name": "media_locales_locale_parent_id_unique", + "columns": [ + { + "expression": "_locale", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "media_locales_parent_id_idx": { + "name": "media_locales_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "media_locales_parent_id_fk": { + "name": "media_locales_parent_id_fk", + "tableFrom": "media_locales", + "tableTo": "media", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tour_dates": { + "name": "tour_dates", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_order": { + "name": "_order", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "event_date": { + "name": "event_date", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true + }, + "venue": { + "name": "venue", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "location_url": { + "name": "location_url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "ticket_url": { + "name": "ticket_url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "tour_dates__order_idx": { + "name": "tour_dates__order_idx", + "columns": [ + { + "expression": "_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tour_dates_event_date_idx": { + "name": "tour_dates_event_date_idx", + "columns": [ + { + "expression": "event_date", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tour_dates_updated_at_idx": { + "name": "tour_dates_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tour_dates_created_at_idx": { + "name": "tour_dates_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.music_items": { + "name": "music_items", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_order": { + "name": "_order", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "enum_music_items_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "src": { + "name": "src", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "href": { + "name": "href", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "music_items__order_idx": { + "name": "music_items__order_idx", + "columns": [ + { + "expression": "_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "music_items_updated_at_idx": { + "name": "music_items_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "music_items_created_at_idx": { + "name": "music_items_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.music_items_locales": { + "name": "music_items_locales", + "schema": "", + "columns": { + "category": { + "name": "category", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_locale": { + "name": "_locale", + "type": "_locales", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "music_items_locales_locale_parent_id_unique": { + "name": "music_items_locales_locale_parent_id_unique", + "columns": [ + { + "expression": "_locale", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "music_items_locales_parent_id_idx": { + "name": "music_items_locales_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "music_items_locales_parent_id_fk": { + "name": "music_items_locales_parent_id_fk", + "tableFrom": "music_items_locales", + "tableTo": "music_items", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.lyrics": { + "name": "lyrics", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_order": { + "name": "_order", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "album": { + "name": "album", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "date": { + "name": "date", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "enum_lyrics_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'draft'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "lyrics__order_idx": { + "name": "lyrics__order_idx", + "columns": [ + { + "expression": "_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "lyrics_updated_at_idx": { + "name": "lyrics_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "lyrics_created_at_idx": { + "name": "lyrics_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.lyrics_locales": { + "name": "lyrics_locales", + "schema": "", + "columns": { + "lyrics": { + "name": "lyrics", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_locale": { + "name": "_locale", + "type": "_locales", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "lyrics_locales_locale_parent_id_unique": { + "name": "lyrics_locales_locale_parent_id_unique", + "columns": [ + { + "expression": "_locale", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "lyrics_locales_parent_id_idx": { + "name": "lyrics_locales_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "lyrics_locales_parent_id_fk": { + "name": "lyrics_locales_parent_id_fk", + "tableFrom": "lyrics_locales", + "tableTo": "lyrics", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_doors": { + "name": "calendar_doors", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "day": { + "name": "day", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "color": { + "name": "color", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "image_id": { + "name": "image_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "_objectkey": { + "name": "_objectkey", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "thumbnail_u_r_l": { + "name": "thumbnail_u_r_l", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "filename": { + "name": "filename", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "mime_type": { + "name": "mime_type", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "filesize": { + "name": "filesize", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "width": { + "name": "width", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "height": { + "name": "height", + "type": "numeric", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "calendar_doors_day_idx": { + "name": "calendar_doors_day_idx", + "columns": [ + { + "expression": "day", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "calendar_doors_image_idx": { + "name": "calendar_doors_image_idx", + "columns": [ + { + "expression": "image_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "calendar_doors_updated_at_idx": { + "name": "calendar_doors_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "calendar_doors_created_at_idx": { + "name": "calendar_doors_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "calendar_doors_filename_idx": { + "name": "calendar_doors_filename_idx", + "columns": [ + { + "expression": "filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "calendar_doors_image_id_media_id_fk": { + "name": "calendar_doors_image_id_media_id_fk", + "tableFrom": "calendar_doors", + "tableTo": "media", + "columnsFrom": [ + "image_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_doors_locales": { + "name": "calendar_doors_locales", + "schema": "", + "columns": { + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_locale": { + "name": "_locale", + "type": "_locales", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "calendar_doors_locales_locale_parent_id_unique": { + "name": "calendar_doors_locales_locale_parent_id_unique", + "columns": [ + { + "expression": "_locale", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "calendar_doors_locales_parent_id_idx": { + "name": "calendar_doors_locales_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "calendar_doors_locales_parent_id_fk": { + "name": "calendar_doors_locales_parent_id_fk", + "tableFrom": "calendar_doors_locales", + "tableTo": "calendar_doors", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_kv": { + "name": "payload_kv", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "payload_kv_key_idx": { + "name": "payload_kv_key_idx", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_locked_documents": { + "name": "payload_locked_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "global_slug": { + "name": "global_slug", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "payload_locked_documents_global_slug_idx": { + "name": "payload_locked_documents_global_slug_idx", + "columns": [ + { + "expression": "global_slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_updated_at_idx": { + "name": "payload_locked_documents_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_created_at_idx": { + "name": "payload_locked_documents_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_locked_documents_rels": { + "name": "payload_locked_documents_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "users_id": { + "name": "users_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "media_id": { + "name": "media_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tour_dates_id": { + "name": "tour_dates_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "music_items_id": { + "name": "music_items_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "lyrics_id": { + "name": "lyrics_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "calendar_doors_id": { + "name": "calendar_doors_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "payload_locked_documents_rels_order_idx": { + "name": "payload_locked_documents_rels_order_idx", + "columns": [ + { + "expression": "order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_parent_idx": { + "name": "payload_locked_documents_rels_parent_idx", + "columns": [ + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_path_idx": { + "name": "payload_locked_documents_rels_path_idx", + "columns": [ + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_users_id_idx": { + "name": "payload_locked_documents_rels_users_id_idx", + "columns": [ + { + "expression": "users_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_media_id_idx": { + "name": "payload_locked_documents_rels_media_id_idx", + "columns": [ + { + "expression": "media_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_tour_dates_id_idx": { + "name": "payload_locked_documents_rels_tour_dates_id_idx", + "columns": [ + { + "expression": "tour_dates_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_music_items_id_idx": { + "name": "payload_locked_documents_rels_music_items_id_idx", + "columns": [ + { + "expression": "music_items_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_lyrics_id_idx": { + "name": "payload_locked_documents_rels_lyrics_id_idx", + "columns": [ + { + "expression": "lyrics_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_calendar_doors_id_idx": { + "name": "payload_locked_documents_rels_calendar_doors_id_idx", + "columns": [ + { + "expression": "calendar_doors_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "payload_locked_documents_rels_parent_fk": { + "name": "payload_locked_documents_rels_parent_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "payload_locked_documents", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_users_fk": { + "name": "payload_locked_documents_rels_users_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_media_fk": { + "name": "payload_locked_documents_rels_media_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "media", + "columnsFrom": [ + "media_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_tour_dates_fk": { + "name": "payload_locked_documents_rels_tour_dates_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "tour_dates", + "columnsFrom": [ + "tour_dates_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_music_items_fk": { + "name": "payload_locked_documents_rels_music_items_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "music_items", + "columnsFrom": [ + "music_items_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_lyrics_fk": { + "name": "payload_locked_documents_rels_lyrics_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "lyrics", + "columnsFrom": [ + "lyrics_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_calendar_doors_fk": { + "name": "payload_locked_documents_rels_calendar_doors_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "calendar_doors", + "columnsFrom": [ + "calendar_doors_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_preferences": { + "name": "payload_preferences", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "payload_preferences_key_idx": { + "name": "payload_preferences_key_idx", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_preferences_updated_at_idx": { + "name": "payload_preferences_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_preferences_created_at_idx": { + "name": "payload_preferences_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_preferences_rels": { + "name": "payload_preferences_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "users_id": { + "name": "users_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "payload_preferences_rels_order_idx": { + "name": "payload_preferences_rels_order_idx", + "columns": [ + { + "expression": "order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_preferences_rels_parent_idx": { + "name": "payload_preferences_rels_parent_idx", + "columns": [ + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_preferences_rels_path_idx": { + "name": "payload_preferences_rels_path_idx", + "columns": [ + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_preferences_rels_users_id_idx": { + "name": "payload_preferences_rels_users_id_idx", + "columns": [ + { + "expression": "users_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "payload_preferences_rels_parent_fk": { + "name": "payload_preferences_rels_parent_fk", + "tableFrom": "payload_preferences_rels", + "tableTo": "payload_preferences", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_preferences_rels_users_fk": { + "name": "payload_preferences_rels_users_fk", + "tableFrom": "payload_preferences_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_migrations": { + "name": "payload_migrations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "batch": { + "name": "batch", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "payload_migrations_updated_at_idx": { + "name": "payload_migrations_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_migrations_created_at_idx": { + "name": "payload_migrations_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.about_page_carousel": { + "name": "about_page_carousel", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "photo_id": { + "name": "photo_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "about_page_carousel_order_idx": { + "name": "about_page_carousel_order_idx", + "columns": [ + { + "expression": "_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "about_page_carousel_parent_id_idx": { + "name": "about_page_carousel_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "about_page_carousel_photo_idx": { + "name": "about_page_carousel_photo_idx", + "columns": [ + { + "expression": "photo_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "about_page_carousel_photo_id_media_id_fk": { + "name": "about_page_carousel_photo_id_media_id_fk", + "tableFrom": "about_page_carousel", + "tableTo": "media", + "columnsFrom": [ + "photo_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "about_page_carousel_parent_id_fk": { + "name": "about_page_carousel_parent_id_fk", + "tableFrom": "about_page_carousel", + "tableTo": "about_page", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.about_page_carousel_locales": { + "name": "about_page_carousel_locales", + "schema": "", + "columns": { + "alt": { + "name": "alt", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_locale": { + "name": "_locale", + "type": "_locales", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "about_page_carousel_locales_locale_parent_id_unique": { + "name": "about_page_carousel_locales_locale_parent_id_unique", + "columns": [ + { + "expression": "_locale", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "about_page_carousel_locales_parent_id_idx": { + "name": "about_page_carousel_locales_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "about_page_carousel_locales_parent_id_fk": { + "name": "about_page_carousel_locales_parent_id_fk", + "tableFrom": "about_page_carousel_locales", + "tableTo": "about_page_carousel", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.about_page": { + "name": "about_page", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.about_page_locales": { + "name": "about_page_locales", + "schema": "", + "columns": { + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_locale": { + "name": "_locale", + "type": "_locales", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "about_page_locales_locale_parent_id_unique": { + "name": "about_page_locales_locale_parent_id_unique", + "columns": [ + { + "expression": "_locale", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "about_page_locales_parent_id_idx": { + "name": "about_page_locales_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "about_page_locales_parent_id_fk": { + "name": "about_page_locales_parent_id_fk", + "tableFrom": "about_page_locales", + "tableTo": "about_page", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tour_page": { + "name": "tour_page", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tour_page_locales": { + "name": "tour_page_locales", + "schema": "", + "columns": { + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_locale": { + "name": "_locale", + "type": "_locales", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "tour_page_locales_locale_parent_id_unique": { + "name": "tour_page_locales_locale_parent_id_unique", + "columns": [ + { + "expression": "_locale", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tour_page_locales_parent_id_idx": { + "name": "tour_page_locales_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "tour_page_locales_parent_id_fk": { + "name": "tour_page_locales_parent_id_fk", + "tableFrom": "tour_page_locales", + "tableTo": "tour_page", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_settings_door_colors": { + "name": "calendar_settings_door_colors", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "door": { + "name": "door", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "ink": { + "name": "ink", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "locked": { + "name": "locked", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "calendar_settings_door_colors_order_idx": { + "name": "calendar_settings_door_colors_order_idx", + "columns": [ + { + "expression": "_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "calendar_settings_door_colors_parent_id_idx": { + "name": "calendar_settings_door_colors_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "calendar_settings_door_colors_parent_id_fk": { + "name": "calendar_settings_door_colors_parent_id_fk", + "tableFrom": "calendar_settings_door_colors", + "tableTo": "calendar_settings", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_settings": { + "name": "calendar_settings", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "behaviour_visible": { + "name": "behaviour_visible", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "behaviour_year": { + "name": "behaviour_year", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": 2026 + }, + "behaviour_opens_at_hour": { + "name": "behaviour_opens_at_hour", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "behaviour_after_end": { + "name": "behaviour_after_end", + "type": "enum_calendar_settings_behaviour_after_end", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'open'" + }, + "colors_paper": { + "name": "colors_paper", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "colors_ink": { + "name": "colors_ink", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "colors_orange": { + "name": "colors_orange", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "colors_quiet": { + "name": "colors_quiet", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "colors_border": { + "name": "colors_border", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "fonts_title": { + "name": "fonts_title", + "type": "enum_calendar_settings_fonts_title", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'georgia'" + }, + "fonts_accent": { + "name": "fonts_accent", + "type": "enum_calendar_settings_fonts_accent", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'georgia'" + }, + "fonts_body": { + "name": "fonts_body", + "type": "enum_calendar_settings_fonts_body", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "images_background_id": { + "name": "images_background_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "images_share_id": { + "name": "images_share_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "calendar_settings_images_images_background_idx": { + "name": "calendar_settings_images_images_background_idx", + "columns": [ + { + "expression": "images_background_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "calendar_settings_images_images_share_idx": { + "name": "calendar_settings_images_images_share_idx", + "columns": [ + { + "expression": "images_share_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "calendar_settings_images_background_id_media_id_fk": { + "name": "calendar_settings_images_background_id_media_id_fk", + "tableFrom": "calendar_settings", + "tableTo": "media", + "columnsFrom": [ + "images_background_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "calendar_settings_images_share_id_media_id_fk": { + "name": "calendar_settings_images_share_id_media_id_fk", + "tableFrom": "calendar_settings", + "tableTo": "media", + "columnsFrom": [ + "images_share_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_settings_locales": { + "name": "calendar_settings_locales", + "schema": "", + "columns": { + "texts_title": { + "name": "texts_title", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "texts_accent_line": { + "name": "texts_accent_line", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "texts_intro": { + "name": "texts_intro", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "texts_date_range": { + "name": "texts_date_range", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "texts_footer": { + "name": "texts_footer", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "texts_sound_on": { + "name": "texts_sound_on", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "texts_sound_off": { + "name": "texts_sound_off", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "texts_download": { + "name": "texts_download", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "texts_holding": { + "name": "texts_holding", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "_locale": { + "name": "_locale", + "type": "_locales", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "calendar_settings_locales_locale_parent_id_unique": { + "name": "calendar_settings_locales_locale_parent_id_unique", + "columns": [ + { + "expression": "_locale", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "calendar_settings_locales_parent_id_idx": { + "name": "calendar_settings_locales_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "calendar_settings_locales_parent_id_fk": { + "name": "calendar_settings_locales_parent_id_fk", + "tableFrom": "calendar_settings_locales", + "tableTo": "calendar_settings", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public._locales": { + "name": "_locales", + "schema": "public", + "values": [ + "en", + "fr" + ] + }, + "public.enum_music_items_type": { + "name": "enum_music_items_type", + "schema": "public", + "values": [ + "youtube", + "spotify", + "bandcamp" + ] + }, + "public.enum_lyrics_status": { + "name": "enum_lyrics_status", + "schema": "public", + "values": [ + "draft", + "published" + ] + }, + "public.enum_calendar_settings_behaviour_after_end": { + "name": "enum_calendar_settings_behaviour_after_end", + "schema": "public", + "values": [ + "open", + "holding" + ] + }, + "public.enum_calendar_settings_fonts_title": { + "name": "enum_calendar_settings_fonts_title", + "schema": "public", + "values": [ + "georgia", + "fraunces", + "goudy-heavyface", + "caprasimo", + "abril-fatface", + "dm-serif-display", + "playfair-display", + "shrikhand", + "alfa-slab-one", + "righteous", + "monoton", + "blanch-caps", + "bebas-neue" + ] + }, + "public.enum_calendar_settings_fonts_accent": { + "name": "enum_calendar_settings_fonts_accent", + "schema": "public", + "values": [ + "georgia", + "fraunces", + "dm-serif-display", + "playfair-display", + "damion", + "yellowtail", + "lobster" + ] + }, + "public.enum_calendar_settings_fonts_body": { + "name": "enum_calendar_settings_fonts_body", + "schema": "public", + "values": [ + "system", + "jost", + "dm-sans", + "outfit", + "fraunces" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "id": "0e8beebd-1838-446c-9602-2b301c561d1b", + "prevId": "00000000-0000-0000-0000-000000000000" +} \ No newline at end of file diff --git a/src/migrations/20261113_225308_visible_on_by_default.ts b/src/migrations/20261113_225308_visible_on_by_default.ts new file mode 100644 index 0000000..35b2321 --- /dev/null +++ b/src/migrations/20261113_225308_visible_on_by_default.ts @@ -0,0 +1,13 @@ +import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres' + +export async function up({ db, payload, req }: MigrateUpArgs): Promise { + await db.execute(sql` + ALTER TABLE "calendar_settings" ALTER COLUMN "behaviour_visible" SET DEFAULT true; + UPDATE "calendar_settings" SET "behaviour_visible" = true;`) +} + +export async function down({ db, payload, req }: MigrateDownArgs): Promise { + await db.execute(sql` + ALTER TABLE "calendar_settings" ALTER COLUMN "behaviour_visible" SET DEFAULT false; + UPDATE "calendar_settings" SET "behaviour_visible" = false;`) +} diff --git a/src/migrations/index.ts b/src/migrations/index.ts index 0cc6f3b..5a4aa12 100644 --- a/src/migrations/index.ts +++ b/src/migrations/index.ts @@ -2,6 +2,7 @@ import * as migration_20261112_223859_initial from './20261112_223859_initial'; import * as migration_20261112_232319_calendar from './20261112_232319_calendar'; import * as migration_20261112_232323_calendar_checks from './20261112_232323_calendar_checks'; import * as migration_20261113_001547_carousel from './20261113_001547_carousel'; +import * as migration_20261113_225308_visible_on_by_default from './20261113_225308_visible_on_by_default'; export const migrations = [ { @@ -22,6 +23,11 @@ export const migrations = [ { up: migration_20261113_001547_carousel.up, down: migration_20261113_001547_carousel.down, - name: '20261113_001547_carousel' + name: '20261113_001547_carousel', + }, + { + up: migration_20261113_225308_visible_on_by_default.up, + down: migration_20261113_225308_visible_on_by_default.down, + name: '20261113_225308_visible_on_by_default' }, ]; diff --git a/src/payload-types.ts b/src/payload-types.ts index 340249d..e393319 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -529,7 +529,7 @@ export interface CalendarSetting { id: number; behaviour: { /** - * Off: visitors get a holding page. Signed-in members still see the preview. + * The calendar opens to visitors by itself on 1 December. Untick to take it down (visitors get a holding page); tick again to bring it back. Signed-in members always see the preview. */ visible?: boolean | null; year: number; From c897f6cd202527ecde395a9748aef5354adc9a2e Mon Sep 17 00:00:00 2001 From: maxitect Date: Fri, 13 Nov 2026 22:54:29 +0000 Subject: [PATCH 2/4] feat(home): button to the advent calendar from 1 to 24 December --- .../(frontend)/_components/CalendarButton.tsx | 34 +++++++++++++++++++ src/app/(frontend)/_components/HomeClient.tsx | 3 ++ 2 files changed, 37 insertions(+) create mode 100644 src/app/(frontend)/_components/CalendarButton.tsx diff --git a/src/app/(frontend)/_components/CalendarButton.tsx b/src/app/(frontend)/_components/CalendarButton.tsx new file mode 100644 index 0000000..62693d5 --- /dev/null +++ b/src/app/(frontend)/_components/CalendarButton.tsx @@ -0,0 +1,34 @@ +"use client"; + +import Link from "next/link"; +import { useSyncExternalStore } from "react"; +import { useLanguage } from "@/context/LanguageContext"; +import { defaultYear } from "@/lib/calendar/defaults"; +import { getCalendarDay } from "@/lib/calendar/schedule"; + +const subscribe = () => () => {}; + +const isCalendarSeason = () => { + const { today, ended } = getCalendarDay(new Date(), { + year: defaultYear, + opensAtHour: 0, + }); + return today > 0 && !ended; +}; + +/** Shown from 1 to 24 December, Paris time. Checked in the browser so the home page stays static. */ +export default function CalendarButton() { + const { isFrench } = useLanguage(); + const inSeason = useSyncExternalStore(subscribe, isCalendarSeason, () => false); + + if (!inSeason) return null; + + return ( + + {isFrench ? "Le calendrier de l’Avent" : "The advent calendar"} + + ); +} diff --git a/src/app/(frontend)/_components/HomeClient.tsx b/src/app/(frontend)/_components/HomeClient.tsx index c43e85c..3bea2ce 100644 --- a/src/app/(frontend)/_components/HomeClient.tsx +++ b/src/app/(frontend)/_components/HomeClient.tsx @@ -5,6 +5,7 @@ import { useLanguage } from "@/context/LanguageContext"; import { FaVolumeMute, FaVolumeUp, FaPause, FaPlay } from "react-icons/fa"; import dynamic from "next/dynamic"; import Image from "next/image"; +import CalendarButton from "./CalendarButton"; import StaticLogo from "./StaticLogo"; import useHlsVideo, { HLS_SRC, HLS_TYPE } from "./useHlsVideo"; import useIsMounted from "@/utils/useIsMounted"; @@ -116,6 +117,8 @@ export default function HomeClient() { + + {/* Video controls */}