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

Dump schema after every tenant migration #553

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

shterrett
Copy link
Contributor

With an existing tenant in our database, the db/structure.sql file is not updated with migrations for the tenant(s) the first time they're run. We're having to run the migrations a second time so that the db/structure.sql accurately reflects the changes to the database.

This change dumps the schema after every tenant, overwriting the existing file as usual, so that when all the migrations are complete, the schema will be completely up-to-date. The schema is dumped after each tenant rather than after all the migrations in case one of the tenants fails to migrate - the schema will at least continue to represent the current state of the database.

@btagliani
Copy link

Same here, I'm having to run the migrations a second time so that the db schemas reflect the changes to the database.

@chris-bridj
Copy link

Just applying a bump to this – could use this fix in master so I don't have to reference this branch from my project.

@btagliani
Copy link

@mikecmpbll @meganemura Hi guys, sorry to bother, but could someone review this changes please? thanks!

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.

3 participants