When I'm in my root directory of my project (/var/www/project) and issue the command php vendor/bin/phinx create initalMigration it returns
Phinx by Rob Morgan - http://phinx.org. version 0.3.7
[InvalidArgumentException]
The file "phinx.yml" does not exist (in: /vagrant/project, /vagrant/project/).
create [-c|--configuration="..."] [-p|--parser="..."] name
/var/www/project is a symbolic link to /vagrant/project btw. But the exception is right, the phinx.yml is in /vagrant/project/vendor/robmorgan/phinx/. But when I execute the phinx in that bin folder I get the same error. But execute that from /vagrant/project/vendor/robmorgan/phinx/bin/ with the configuration parameter (php vendor/bin/phinx create -c "vendor/robmorgan/phinx/phinx.yml" initialMigration) I get the following output and exception:
Phinx by Rob Morgan - http://phinx.org. version 0.3.7
using config file ./vendor/robmorgan/phinx/phinx.yml
using config parser yaml
using migration path
[InvalidArgumentException]
The directory "" is not writeable
create [-c|--configuration="..."] [-p|--parser="..."] name
Same happens when I cd into the folder /vagrant/project/vendor/robmorgan/phinx/. All of the folders and files have permission 777. Using sudo for the commands doesn't change anything either.
hi @AndreasBackx did you run php vendor/bin/phinx init first in the root of your project?
I did not, so I did that right now. I still get the second exception then when I issue the command create from the project root.
I created the migrations folder now and it works. But initialCommit isn't considered camelcase though.
This is old but I still had the problem here in 2018 for my CakePHP3 application
after running php vendor/bin/phinx init in the root directory it created ./phinx.yml
When running php vendor/bin/phinx seed:create UserSeeder it threw an error about creating seed directory manually
I changed the phinx.yml file
paths:
migrations: %%PHINX_CONFIG_DIR%%/db/migrations
seeds: %%PHINX_CONFIG_DIR%%/db/seeds
with
paths:
migrations: %%PHINX_CONFIG_DIR%%/config/Migrations
seeds: %%PHINX_CONFIG_DIR%%/config/Seeds
This made it find the existing migration directories and work as expected.
@CoedNaked Please do not comment on unrelated issue tickets. If you are using CakePHP3, you don't need to create phinx.yml, as your database configuration is written in your config/app.php. Use CakePHP Migrations plugin instead. If you don't want to use it for some reasons, you would have to change the path settings by yourself. Since Phinx is independent from CakePHP3, I don't think the default paths can be changed only for CakePHP3.
What does that have to do with seeding ? if You say phinx is not for cake
then you should remove it from the cake documentaion as being "THE" way to
seed a database
https://book.cakephp.org/3.0/en/phinx/seeding.html . I am trying to learn
cake but I think it sucks to no end, but at least I am trying.
I did use the Cakephp MIgrations Plugin . but seeding didn't work as the
documentation said. I had the same issues as describe as the problem when
I was trying to seed the database..
On Fri, Jan 12, 2018 at 10:01 PM, Kurita Takashi notifications@github.com
wrote:
@CoedNaked https://github.com/coednaked Please do not comment on
unrelated issue tickets. If you are using CakePHP3, you don't need to
create phinx.yml, as your database configuration is written in your
config/app.php. Use CakePHP Migrations plugin
https://book.cakephp.org/3.0/en/migrations.html instead. If you don't
want to use it for some reasons, you would have to change the path settings
by yourself. Since Phinx is independent from CakePHP3, I don't think the
default paths can be changed only for CakePHP3.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/cakephp/phinx/issues/298#issuecomment-357407883, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AKu58Q1KqWm8oyvM46EEngYstleYsWU5ks5tKCqrgaJpZM4CdhPX
.
@CoedNaked If you have some opinions for the documentation, you could leave your comments on #1219. Or you could open an issue on cakephp/docs if you think the Phinx section should be removed from the CakePHP Cookbook.
but seeding didn't work as the documentation said
https://book.cakephp.org/3.0/en/migrations.html#seed-seeding-your-database Works for me. But If you have some problems, please ask someone on Slack. Or open a new issue on cakephp/migrations if you think it's a bug of the Migration plugin.
Most helpful comment
hi @AndreasBackx did you run
php vendor/bin/phinx initfirst in the root of your project?