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

Autorun migrations in community edition #5141

Merged
merged 5 commits into from Apr 19, 2023

Conversation

apoorv-mishra
Copy link
Collaborator

Closes #4680

@auto-assign auto-assign bot requested a review from tommoor April 1, 2023 17:40
Comment on lines 73 to 75
Logger.warn(
"Please run `yarn db:migrate` or `yarn db:migrate --env production-ssl-disabled` to run all pending migrations"
);
Copy link
Member

@tommoor tommoor Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Logger.warn(
"Please run `yarn db:migrate` or `yarn db:migrate --env production-ssl-disabled` to run all pending migrations"
);

It's ok, I don't need this and this is only a safety measure for cloud now so we can delete.

} catch (err) {
Logger.warn(chalk.red("Failed to run migrations!"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Logger.warn(chalk.red("Failed to run migrations!"));

This is resulting in a double error, seems fine without?
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe removing db:migrate from Makefile resolves this. No further action needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it changes it to be honest, I'm easy either way here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first error is logged from within the sequelize cli 🙈

Catching errors centrally within checkMigrations now.

@tommoor
Copy link
Member

tommoor commented Apr 11, 2023

Oh, I meant to add we should remove the db:migrate call from within the Makefile as it'll be run twice now in dev mode.

@apoorv-mishra apoorv-mishra merged commit dadba3f into main Apr 19, 2023
11 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fix/4680/autorun-migrations branch April 19, 2023 03:57
@patzm
Copy link
Sponsor

patzm commented Apr 24, 2023

awesome feature!!! Thanks @apoorv-mishra, this has always been a pain for me. In particular in a docker-compose stack, in which the just run a command thinking isn't really native.

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.

Run migrations in community edition automatically
3 participants