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

Search for "executed" instead of "pending" migrations using db:seed:undo:all #391

Closed
wants to merge 1 commit into from

Conversation

AlexisNo
Copy link

@AlexisNo AlexisNo commented Nov 14, 2016

When I started using a sequelize seeder storage, db:seed:undo:all did not worked anymore. After some investigations, I noticed that the command was looking for pending migrations instead of executed migrations. The similar behavior is correct for db:migration:undo:all.

I guess the problem does not occur when we do not use a storage because in this case there is no executed vs pending migrations.
The PR causes the unwanted behavior to occur when NOT using a storage. But does it really make sense to use this command without using a storage since there is no executed / pending migration in this case? Similarly when not using a storage, db:seed:all will execute seeds even if they already have been executed before, while using a storage, only pending seeds are executed.

If the desired behavior really is to consider all migrations as "pending" when not using a storage, I think this should be defined in Umzug's none storage and not in the sequelize CLI.

Any thoughts #?

@mention-bot
Copy link

@AlexisNo, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fossamagna, @sdepold and @Americas to be potential reviewers.

@AlexisNo
Copy link
Author

AlexisNo commented Nov 14, 2016

I've just seen this issue #308 and a similar PR #253. But this one tries to set the pending state for the "no storage" case in the CLI.

@AlexisNo
Copy link
Author

The test suite breaks because it does not use a storage, but the title of the test relates more to the use of a storage:

[MYSQL] bin/sequelize db:seed:undo:all is correctly undoing all seeders if they have been done already

The "been done already" check can only be performed using a storage.

https://github.com/sequelize/cli/blob/master/test/db/seed/undo/all.test.js#L55

@sagarsharma76
Copy link

When are we going to have this PR merged. This is important and needs to be fixed asap.

@AlexisNo AlexisNo changed the title Search executed instead of pending migrations using db:seed:undo:all Search for "executed" instead of "pending" migrations using db:seed:undo:all Dec 23, 2016
@stephengfriend
Copy link

Just ran into this issue using "seederStorage": "sequelize" option in .sequelizerc. Any idea when it might get resolved?

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.

4 participants