Skip to content

Dump schema after every tenant migration#553

Open
shterrett wants to merge 2 commits intoinfluitive:developmentfrom
shterrett:dump-schema-every-tenant
Open

Dump schema after every tenant migration#553
shterrett wants to merge 2 commits intoinfluitive:developmentfrom
shterrett:dump-schema-every-tenant

Conversation

@shterrett
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

@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