-
-
Notifications
You must be signed in to change notification settings - Fork 179
🗃️ Issue #3540 db migration #3543
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
Conversation
5bf05a5 to
2c0288b
Compare
61266a4 to
1529cba
Compare
3809593 to
d78d246
Compare
|
This PR is ready to review. Sorry for the noise during the development ;-) |
d78d246 to
d6d516a
Compare
|
Related issue #3021 |
|
Hii @macintoshplus, the migrations are dropping tables first before re-creating them. What if I have data in those tables that needs to be preserved? |
The migration does not remove existing tables and data. It's the goal to use migrations. Bolt can used with various DBMSs like SQLite (used in test mainly), MariaDB/MySQL, or Postgres. Generating one migration for 3 DBMSs is so hard. However using migration is necessary to manage changes with data effect. In this PR, I have added the database dumps for MySQL/MariaDB to enable the migration tests and check if no change has been lost in migrations. |
I am sorry if I misunderstood this PR then. So can I now safely upgrade from Bolt 5.1 to the latest 5.2.2 and run (how please?) DB migrations or should I wait for this PR to be merged? |
You have 2 choices:
To execute migration run this command: |
|
Hi @macintoshplus and @bobvandevijver. Is there any blocker or can this be merged please? |
|
I can't merge without review validation. Please wait. |
|
I'm currently planning on fully removing the supplied migrations from Bolt core in version 6, as migrations heavily depend on the exact database being used. Bolt does offer the entities and will still offer the required schema for the database, it just becomes the developer responsibility to make them. I will look into offering a migration guide to squash your existing migrations, something like described here: https://jolicode.com/blog/a-new-way-to-squash-your-doctrine-migrations. |
This PR fixes issue #3540 and updates the Doctrine migrations to update MySQL/MariaDB database from Bolt version 4.2, 5.0, and 5.1.
A GitHub Action workflow has been added to check if migration is missing in the future (only for MySQL/MariaDB).