0

i want to have a better overview on the phinx migration files. i want something like this

/db/migration/1.8.5/ID-2065/my_file_name_1234567890

So i can use

 'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations/'. $_ENV['APP_VERSION'],

In the docs only is something like this

migrations: %%PHINX_CONFIG_DIR%%/module/*/{data,scripts}/migrations

But how can i use there maybe a param from the command line.

See you

Rogoit
  • 81
  • 7

1 Answers1

0

If your using the default YAML based configuration you can try using Phinx ENV vars (PHINX_ prefix) and then use a %%PHINX_VARNAME%% replacement. Note: I haven't actually tried this before. Read more about them here: http://docs.phinx.org/en/latest/configuration.html#external-variables

Otherwise if your using a PHP-based configuration file you can definitely access the $_ENV superglobal as you have described. Just be sure to call your bootstrap/init scripts so your application version is injected.

Rob

Rob Morgan
  • 346
  • 2
  • 4
  • Hi, thx for response. But there is still a problem. I can not set every time an env var for a new ticket id. I need this structure /1.6.6/SUP-4579/table_name_201608081524. So i can get the release number from env. But how can i do it for a ticket folder. When i use "*" the create command will make a folder named */. Also the migration is not read out recursive from a folder structure. The problem is that i can not use a flat folder structure for all migration files next year. Also the timestamp must be the last part of the name. Otherwise we can not use it. Because we will have now overview – Rogoit Sep 02 '16 at 08:41
  • So i can do the create and move the file man to a subdirectory. But how can i tell phinx to search the migration folder recursive? – Rogoit Sep 02 '16 at 09:03