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

feat: add step option to Migrator #940

Closed
wants to merge 0 commits into from

Conversation

MaximeMRF
Copy link
Contributor

@MaximeMRF MaximeMRF commented Jun 17, 2023

Proposed changes

Currently Migrator does not allow rollback only a defined number of migrations. With the step option you can choose the number of migration you want to rollback.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

@MaximeMRF MaximeMRF changed the title Adding step option to Migrator feat: add step option to Migrator Jun 17, 2023
@thetutlage
Copy link
Member

@MaximeMRF I have no idea what does step migration does. So please explain me the concept of step migration and its use cases :)

@MaximeMRF
Copy link
Contributor Author

Hello @thetutlage

The step flag allow the rollback of a number of migrations and it not depend of batch. The rollback is made on the last migrations: for example if I have a step of 3, the 3 last migrations will be rollback.

I think there is many use cases that step can be great like if you migrate new files but you have make a mistake on the last one.

Copy link

stale bot commented Dec 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Dec 15, 2023
@RomainLanz
Copy link
Member

RomainLanz commented Mar 8, 2024

Hey @MaximeMRF! 👋🏻

Could you re-open a PR for AdonisJS 6?

@stale stale bot removed the Status: Abandoned Dropped and not into consideration label Mar 8, 2024
@MaximeMRF
Copy link
Contributor Author

Hi @RomainLanz, yes if you are interested by the feature ? otherwise i will just delete this PR

@thetutlage
Copy link
Member

Sorry, I slept on this because was super busy with v6 stuff at that point in time.

To be honest, I am not very keen to add this feature and maintain it in the long run. I agree that there are use-cases for this, but its not something most of the users need (including myself).

Again, I am looking at it from the maintainability point of view and not disregarding the use-case for the feature.

@RomainLanz
Copy link
Member

To be honest, I am not very keen to add this feature and maintain it in the long run. I agree that there are use-cases for this, but its not something most of the users need (including myself).

I disagree. This feature is really useful for managing exactly how your rollback flow will be executed. It is especially useful in development when you are using migration:fresh quite a lot, meaning all your migrations are in the same batch.

@MaximeMRF
Copy link
Contributor Author

Agree with @RomainLanz it will be very helpful for development and also to reproduce exact batch of the production environment in development.
Maybe I'm wrong but the implementation is quit simple and i think it's doesn't complicate the codebase.

Actually I have only implemented the step option for the rollback command but i believe that it can be useful if the step option is also available for the refresh command.

@thetutlage
Copy link
Member

Yeah, had a word with @RomainLanz in private and I am on-board with the changes. Please open a PR for v6 and we will be happy to accept it :)

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.

None yet

3 participants