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

Add a possibility to rollback an action #27

Open
ja-tomasz opened this issue Feb 3, 2017 · 2 comments
Open

Add a possibility to rollback an action #27

ja-tomasz opened this issue Feb 3, 2017 · 2 comments
Labels

Comments

@ja-tomasz
Copy link

Would be good for each generator, but at least for a specific resource - that would look for migration, model, controller and routes and delete them if found. Especially useful since the "resources" generator currently creates and runs the migration. See the other isse I reported.

@webNeat
Copy link
Owner

webNeat commented Feb 3, 2017

Hello,

Rolling back any action is not a simple problem, it's like writting a mini VCS just for the generated/modified files.

I guess there are mostly two cases in which you will need a rollback:

  1. You accidently generated something you don't need. You mostly need to just delete the files/lines added by the generators.
    If you generated a migration that was applied, you will need to rollback migrations first, remove it, run composer dump-autoload, then re-apply migrates.

  2. You accidentally typed something wrong. You simply rerun the command with --force=true. Again if there was a migration, you should rollback migrations and delete the wrong one manually before re-running the command.

Hope this solves most of the issues :)

@ja-tomasz
Copy link
Author

yes, I use VCS to remove the generated files, but its just an additional tool you need to use.

Maybe marking the generated code (migraton, routes, factories) with some comment that would help recognizing it when using --force=true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants