Files
geointel/skills/postgis-migration/SKILL.md
T
Codex 6ea3586a3e
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled
Initial GeoIntel V1 foundation
2026-06-16 23:36:32 +02:00

1.2 KiB

Skill: PostGIS Migration

Use this skill when creating database models, migrations, geometry storage or spatial indexes.

Read first

  • docs/DATABASE_SCHEMA.md
  • docs/DATABASE_IMPLEMENTATION_PLAN.md
  • docs/standards/GIS_STANDARDS.md
  • docs/specs/STATE_MACHINES.md
  • relevant ADRs

Spatial rules

  • PostgreSQL + PostGIS is mandatory.
  • Store canonical geometry in PostGIS geometry columns.
  • Preserve original CRS metadata on datasets.
  • Normalize internal spatial operations according to GIS standards.
  • Create spatial indexes for queryable geometries.
  • Use explicit units for area, distance and length.

Migration checklist

  • Add model.
  • Add migration.
  • Add indexes.
  • Add constraints.
  • Add state enum where required.
  • Add rollback-safe migration where practical.
  • Add fixture/test coverage for geometry roundtrip.

Forbidden shortcuts

  • No geometry as unvalidated plain text for canonical records.
  • No silent CRS assumptions.
  • No schema drift from docs without updating the contract.

Completion report fields

  • Tables changed.
  • Geometry columns added.
  • Indexes added.
  • Migration commands run.
  • Compatibility risks.