-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
phinx.php
32 lines (28 loc) · 909 Bytes
/
phinx.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
use BZIon\Composer\ScriptHandler;
require("vendor/autoload.php");
$config = ScriptHandler::getDatabaseConfig();
$testConfig = ScriptHandler::getDatabaseConfig(true);
return array(
'paths' => array(
'migrations' => __DIR__ . '/migrations'
),
'environments' => array(
'default_migration_table' => 'migration_log',
'default_database' => 'main',
'main' => array(
'adapter' => 'mysql',
'host' => $config['host'],
'name' => $config['database'],
'user' => $config['username'],
'pass' => $config['password']
),
'test' => ($testConfig) ? array(
'adapter' => 'mysql',
'host' => $testConfig['host'],
'name' => $testConfig['database'],
'user' => $testConfig['username'],
'pass' => $testConfig['password']
) : null
)
);