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

Add ability to consolidate migrations #211

Open
LukeTowers opened this Issue Feb 8, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@LukeTowers
Member

LukeTowers commented Feb 8, 2018

I would like to add a "Consolidate Migrations" feature that would use https://github.com/Xethron/migrations-generator to get the current schema of plugin tables and then create one migration file per table and put them all under version 1.0.1 Initial Setup of version.yaml.

The idea of this feature would be to allow people to simplify their migrations after a period of rapid development using the builder to clean up the plugin preparing it for release. The version tracking history of migrations doesn't make sense to retain when the plugin isn't out of the scaffolding process yet.

The order that this feature would do things would be:

  1. User scaffolds out their plugin, changing their minds on the schema numerous times during the process
  2. User decides that they're getting close enough to a release or sharing the code that they want to clean things up a bit and presses the "Consolidate Migrations" button
  3. We scan the schema for all the tables used by the current plugin, use the library above to generate new migrations for them, and then remove the current plugin migration information from the database (run down on all existing migrations, remove plugin_version and plugin_history).
  4. We drop the newly generated migrations in the updates folder, then update version.yaml to include all the migrations in one version.

Thoughts?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 22, 2018

This feature is needed. Should there be a button per table?

ghost commented Feb 22, 2018

This feature is needed. Should there be a button per table?

@CptMeatball

This comment has been minimized.

Show comment
Hide comment
@CptMeatball

CptMeatball Feb 22, 2018

I think this also should be available for normal plugin development. Maybe make it part of the October artisan commands.

CptMeatball commented Feb 22, 2018

I think this also should be available for normal plugin development. Maybe make it part of the October artisan commands.

@pvullioud

This comment has been minimized.

Show comment
Hide comment
@pvullioud

pvullioud Feb 28, 2018

Contributor

This is a good and useful idea. I used this package before to create migration from an existing table. It works well .

Contributor

pvullioud commented Feb 28, 2018

This is a good and useful idea. I used this package before to create migration from an existing table. It works well .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment