dbmigrations
dbmigrations copied to clipboard
PostgreSQL: If a migration changes schema, migration fails to insert into installed_migrations
We have all our tables in a custom schema. I created the initial migration with pg_dump and then performing a little cleanup. In this script, it begins with:
CREATE SCHEMA uniplex;
SET search_path = uniplex, pg_catalog;
However, moo upgrade begins by creating installed_migrations in the public schema. This means that moo upgrade results in a crash, as the inserts aren't qualified with a schema (and the final INSERT INTO installed_migrations thus tries to INSERT into uniplex.installed_migrations)
Thanks for the report! If I understand this correctly, the fix is just to qualify all operations on the installed_migrations table with the public schema. Right?
I would also be open to making the schema for installed_migrations configurable if that would be desirable (and default to public if unspecified).
I can get to this in the next few days, but please feel free to submit a patch if you can do it sooner!
Yep, just prefixing should be sufficient.
Since this package is no longer maintained, I'd like to mark the GitHub repository as read-only. I'm closing this ticket as part of that change. This package is now marked as deprecated on Hackage; see the maintenance note in the README if you're interested in taking over maintenance.