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

Issue with marking all as migrated #124

Closed
dereuromark opened this issue Sep 13, 2015 · 5 comments
Closed

Issue with marking all as migrated #124

dereuromark opened this issue Sep 13, 2015 · 5 comments
Milestone

Comments

@dereuromark
Copy link
Member

If you try to run Migrations mark_migrated 123 it will tell you that this is not a valid version.
But if you do Migrations mark_migrated * with the wildcard operator it will say

Migration successfully marked migrated !

But will just add 0 as version in the DB. Doing it again results in

An error occurred : SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

Now, while I think * was never really supported, I think the intuitive thing here would actually to support marking all as migrated.

@HavokInspiration HavokInspiration added this to the 1.3.1 milestone Sep 13, 2015
@HavokInspiration
Copy link
Member

This is an interesting idea.
About the * operator, it is indeed not supported. To be honest, the unexpected result from using might be due to some conditions being matched by a glob or something like that. I will look into that.

What about mark_migrated all instead of the * ?

@dereuromark
Copy link
Member Author

I dont think it warrants an own command as the use case is not that common.

@HavokInspiration
Copy link
Member

No no I was thinking of adding a special value "all" to the $version argument of the mark_migrated command. If used instead of a date all found migrations will ne migrated.

-----Message d'origine-----
De : "Mark S." notifications@github.com
Envoyé : ‎13/‎09/‎2015 11:33
À : "cakephp/migrations" migrations@noreply.github.com
Cc : "Yves P." havokinspiration@gmail.com
Objet : Re: [migrations] Issue with marking all as migrated (#124)

I dont think it warrants an own command as the use case is not that common.

Reply to this email directly or view it on GitHub.

@dereuromark
Copy link
Member Author

I see.
Well, either way works for me. The wildcard on the same command just made sense to me from a UNIX point of view ;)

@dereuromark
Copy link
Member Author

Closing as PR is open.

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

No branches or pull requests

2 participants