Skip to content

Use Postgres arrays

Andy Dirnberger requested to merge use-postgres-arrays into master

We use JSON fields to store some list-like data. These fields would be better served by array fields. This will switch the fields from a third-party JSON field to SQLAlchemy's own array, dropping the dependency on the third-party library.

Postgres does not supporting changing a JSON field into an array. The provided migration will add an array field with a temporary name, update it with the values from the JSON field, drop the JSON field, and rename the array field to the original field's name.

Because of the complexity of this migration, it isn't being given a downgrade option. Any attempt to downgrade past this revision will fail.

Closes #82

Merge request reports