lulco/phoenix

Calling the migrate command with the --class parameter requires a slash before the class name

Closed this issue · 2 comments

Steps to reproduce:
On the status command, I see a list of classes for migration:

$ php vendor/bin/phoenix status

Migrations to execute
+--------------------+------------------+
| Migration datetime | Class name       |
+--------------------+------------------+
| 20210330100439     | AddAttempts      |
+--------------------+------------------+

All done. Took 0.0104s

I have a class without a namespace.
I am trying to execute the command, but I cannot find the class.

$ php vendor/bin/phoenix migrate --class=AddAttempts

Nothing to migrate

All done. Took 0.0054s

If you add a slash before the class name, then everything works.

$ php vendor/bin/phoenix migrate --class=\AddAttempts
lulco commented

Hi @fishus,

--class=\AddAttempts

should not work too, because something (probably symfony command?) strips backslash from input. You need to add quotes around:

--class="\AddAttempts"

But you are right, I can add backslash to start of each class which doesn't have any and your case will work also with

--class=AddAttempts
lulco commented

@fishus should be fixed, check master please and confirm.

Also please check if previous version works with

--class=\AddAttempts

as you declared before because if yes, maybe stripping backlash is not problem of symfony command but bash / shell or something else