yesodweb / yesodweb/persistent
`SqlOther "GEOGRAPH(POINT,4326)` gets re-migrated every time migrateAll is called
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
I created the following postgis type and made it persistent compatible.
data GeoPoint = ...
instance PersistField GeoPoint where
...
instance PersistFieldSql GeoPoint where
sqlType _ = SqlOther "GEOGRAPHY(POINT,4326)"
It seems to work ok, however for whatever reason it seems to re-migrate every column that uses it every time migrateAll is called, even though after the first time it should be a no-op / it should be detected as equal and not in need of migration.
Specifically I get:
Migrating: ALTER TABLE "geo_test" ALTER COLUMN "geopoint_test" TYPE GEOGRAPHY(POINT,4326)
[Debug#SQL] ALTER TABLE "geo_test" ALTER COLUMN "geopoint_test" TYPE GEOGRAPHY(POINT,4326); []
Every time.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown GeoPoint PersistField and PersistFieldSql instances, then trace migrateAll's comparison of the SqlOther "GEOGRAPHY(POINT,4326)" type. The fix is complete when the first migration applies the ALTER TABLE and a subsequent migrateAll call treats the column as unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100