1
0
Fork 0
polaris-task-force/src/migrations/20260921_130500_weather_freeform.ts
Z8MB1E 9bbe44d38d feat(map): world map picker entry, intel fields, node icons, generic markers
- 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)
2026-09-21 20:47:46 -04:00

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;`)
}