How to use Phoenix generators with PostGIS column types, with minimal changes to get tests, changesets, and schema working.

Requirement: I need to create a schema that includes a PostGIS Point columm.

Problem: Phoenix generators are great, but they don’t support special types, such as PostGIS columns.

The docs for geo_postgis are sufficient for figuring out how to work with geographic data types, but they don’t cover how to make it work with Phoenix generators, changesets, or tests.

Goal: Use Phoenix generators (since contexts are too useful to ignore), and have the generated changesets, views, and tests work with only minor tweaks.

How: Use virtual attributes in the Ecto schema to be the bridge to the custom type.