Fix calendar schema defaults

This commit is contained in:
Tero Halla-aho 2025-11-27 12:50:17 +02:00
parent a3ac05bf08
commit 4411f247ab
3 changed files with 4 additions and 4 deletions

View file

@ -297,7 +297,7 @@ export async function POST(req: Request) {
hasBarbecue: Boolean(body.hasBarbecue),
evCharging: normalizeEvCharging(body.evCharging),
priceHintPerNightEuros,
calendarUrls: calendarUrls.length ? calendarUrls : null,
calendarUrls,
contactName,
contactEmail,
contactPhone: body.contactPhone ?? null,

View file

@ -1,2 +1,2 @@
-- Add optional calendar URLs for availability sync (PostgreSQL text array)
ALTER TABLE "Listing" ADD COLUMN "calendarUrls" TEXT[];
-- Add calendar URLs for availability sync (PostgreSQL text array)
ALTER TABLE "Listing" ADD COLUMN "calendarUrls" TEXT[] NOT NULL DEFAULT ARRAY[]::TEXT[];

View file

@ -93,7 +93,7 @@ model Listing {
hasWashingMachine Boolean @default(false)
hasBarbecue Boolean @default(false)
evCharging EvCharging @default(NONE)
calendarUrls String[]? @db.Text[]
calendarUrls String[] @db.Text @default([])
priceHintPerNightEuros Int?
contactName String
contactEmail String