fix: add captions
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
Benno Tielen 2026-06-09 13:37:37 +02:00
parent a12e460448
commit 636222eead
5 changed files with 26088 additions and 1 deletions

View file

@ -165,6 +165,13 @@ export const Parish: CollectionConfig = {
relationTo: 'media', relationTo: 'media',
required: true required: true
}, },
{
name: 'caption',
label: {
de: 'Bildunterschrift'
},
type: 'text'
},
], ],
minRows: 3, minRows: 3,
maxRows: 12 maxRows: 12

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,19 @@
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'
export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
await db.execute(sql`
ALTER TABLE "announcement" ALTER COLUMN "date" SET DEFAULT '2026-06-14T11:32:58.445Z';
ALTER TABLE "calendar" ALTER COLUMN "date" SET DEFAULT '2026-06-14T11:32:58.773Z';
ALTER TABLE "classifieds" ALTER COLUMN "until" SET DEFAULT '2026-07-09T11:32:58.852Z';
ALTER TABLE "parish_gallery" ADD COLUMN "caption" varchar;
ALTER TABLE "_parish_v_version_gallery" ADD COLUMN "caption" varchar;`)
}
export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
await db.execute(sql`
ALTER TABLE "announcement" ALTER COLUMN "date" SET DEFAULT '2026-06-07T13:08:42.418Z';
ALTER TABLE "calendar" ALTER COLUMN "date" SET DEFAULT '2026-06-07T13:08:42.705Z';
ALTER TABLE "classifieds" ALTER COLUMN "until" SET DEFAULT '2026-07-05T13:08:42.759Z';
ALTER TABLE "parish_gallery" DROP COLUMN "caption";
ALTER TABLE "_parish_v_version_gallery" DROP COLUMN "caption";`)
}

View file

@ -48,6 +48,7 @@ import * as migration_20260605_095112 from './20260605_095112';
import * as migration_20260605_113107_occurrence_end_time from './20260605_113107_occurrence_end_time'; import * as migration_20260605_113107_occurrence_end_time from './20260605_113107_occurrence_end_time';
import * as migration_20260605_124103_gallery_caption from './20260605_124103_gallery_caption'; import * as migration_20260605_124103_gallery_caption from './20260605_124103_gallery_caption';
import * as migration_20260605_130843_add_worship_language_other from './20260605_130843_add_worship_language_other'; import * as migration_20260605_130843_add_worship_language_other from './20260605_130843_add_worship_language_other';
import * as migration_20260609_113259_parish_gallery_caption from './20260609_113259_parish_gallery_caption';
export const migrations = [ export const migrations = [
{ {
@ -298,6 +299,11 @@ export const migrations = [
{ {
up: migration_20260605_130843_add_worship_language_other.up, up: migration_20260605_130843_add_worship_language_other.up,
down: migration_20260605_130843_add_worship_language_other.down, down: migration_20260605_130843_add_worship_language_other.down,
name: '20260605_130843_add_worship_language_other' name: '20260605_130843_add_worship_language_other',
},
{
up: migration_20260609_113259_parish_gallery_caption.up,
down: migration_20260609_113259_parish_gallery_caption.down,
name: '20260609_113259_parish_gallery_caption'
}, },
]; ];

View file

@ -317,6 +317,7 @@ export interface Parish {
gallery?: gallery?:
| { | {
photo: string | Media; photo: string | Media;
caption?: string | null;
id?: string | null; id?: string | null;
}[] }[]
| null; | null;
@ -1700,6 +1701,7 @@ export interface ParishSelect<T extends boolean = true> {
| T | T
| { | {
photo?: T; photo?: T;
caption?: T;
id?: T; id?: T;
}; };
updatedAt?: T; updatedAt?: T;