Phinx migration not running on server after commit in SVN repository

439 Views Asked by At

We have a SVN repository in a remote server and I have a copy of it in my local machine. We are using phinx for database migrations. So locally I create a migration and run it so I am sure the table is created and it does. The migration file is tracked by the repository. So I commit it and then trying to run the migration on the remote server. But the migration seems not to run. All I am getting is this message and then nothing

Phinx by Rob Morgan. version 0.3.4

using config file ./phinx.php
using config parser php
using migration path 
/srv/www/subversion/MyProject/trunk/www/src/db-migrations
using environment production
using adapter mysql
using database MyDatase

The project in the remote server is located in /srv/wwww/subversion/MyProject/trunk/www. In the remote server I run the migration inside the www folder like

php htdocs/vendor/robmorgan/phinx/bin/phinx migrate -c phinx.php -e production

EDIT: the phinxlog in the database does not show my migration at all. Last one set to 20 days ago

1

There are 1 best solutions below

0
On BEST ANSWER

It turns out that you need to run the migration as a specific user, the one defined in the project's config.php, and not as root. So in my case it was:

 sudo -u USER php htdocs/vendor/robmorgan/phinx/bin/phinx migrate -c phinx.php -e production

Worked like a charm!