-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphinx.php
32 lines (28 loc) · 857 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
require __DIR__ . '/vendor/autoload.php';
$localConfig = Nette\Neon\Neon::decode(file_get_contents(__DIR__ . '/app/config/config.local.neon'));
$dsn = $localConfig['database']['dsn'];
$dsnArray = explode(';dbname=', $dsn);
$dsnHost = explode(':host=', $dsnArray[0]);
$dsnDb = $dsnArray[1];
$adapter = $dsnHost[0];
$host = $dsnHost[1];
$database = $dsnDb;
$user = $localConfig['database']['user'];
$password = $localConfig['database']['password'];
return [
'paths' => [
'migrations' => 'app/migrations'
],
'environments' => [
"default_migration_table" => "_phinx_log",
"default_database" => "production",
"production" => array(
"adapter" => $adapter,
"host" => $host,
"name" => $database,
"user" => $user,
"pass" => $password
)
]
];