Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix database migration edge cases #110

Merged
merged 9 commits into from
May 9, 2024
Merged

Conversation

piercefreeman
Copy link
Owner

@piercefreeman piercefreeman commented May 9, 2024

This PR mainly addresses edge cases with our experimental data migration plugin.

  • Add additional unit tests to check expected transformation when executed against Postgres. This validates the accuracy (and syntax) of our templated SQL queries.
  • Workaround for dropping enums from existing table columns. Enums in Postgres can't be modified in-place, so the best workaround is to recreate them and then drop the old values. We now keep track of where enum values are referenced so we can migrate these to a new enum object that will replace the old one.
  • Add support for "check" constraints.
  • Modify a group of enum values at the same time (ie. pass all different enums) to avoid verbose migration files and repeated SQL commands to create/drop old enum types.
  • Allow reserved table names within identifier strings (like a "user" table separate from the postgres "USER" command).

We also add some initial docs on getting started with the migration pipeline.

@piercefreeman piercefreeman force-pushed the feature/migration-fixes branch from 729cff3 to a0937e2 Compare May 9, 2024 05:06
@piercefreeman piercefreeman merged commit 33686ec into main May 9, 2024
19 checks passed
@piercefreeman piercefreeman deleted the feature/migration-fixes branch May 9, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant