- Maps gain worldMap flag, description, freeform weather, latitude/longitude, easeOfAccess and factionControl; picker cards render them as stat tags - resource-nodes gain a shared icon set and may exist with no resources as plain marker nodes (placement ignores marker-only nodes) - sidebar gains the World Map entry; Infrastructure section gets defaultOpen - migrations 20260921_120000/123000/130500/134000; includes the generated types/schema sweep (currency emblem fields land in the next commit)
11 lines
747 B
TypeScript
11 lines
747 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 "maps" ALTER COLUMN "weather" TYPE text USING "weather"::text;
|
|
DROP TYPE IF EXISTS "public"."enum_maps_weather";`)
|
|
}
|
|
|
|
export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
|
|
await db.execute(sql`CREATE TYPE "public"."enum_maps_weather" AS ENUM('clear', 'overcast', 'rain', 'storm', 'fog', 'snow');
|
|
ALTER TABLE "maps" ALTER COLUMN "weather" TYPE "public"."enum_maps_weather" USING CASE WHEN "weather" IN ('clear', 'overcast', 'rain', 'storm', 'fog', 'snow') THEN "weather"::"public"."enum_maps_weather" ELSE NULL END;`)
|
|
}
|