-
Notifications
You must be signed in to change notification settings - Fork 2
/
phinx.php
34 lines (32 loc) · 934 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
33
34
<?php
if(file_exists('.env')) {
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
}
$dbopts = parse_url(getenv('DATABASE_URL'));
return [
'paths' => [
'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations'
],
'environments' => [
'default_database'=> 'development',
'production' => [
'adapter' => 'pgsql',
'host' => $dbopts["host"],
'name' => ltrim($dbopts["path"],'/'),
'user' => $dbopts['user'],
'pass' => $dbopts['pass'],
'port' => $dbopts['port'],
'charset' => 'UTF-8'
],
'development' => [
'adapter' => 'pgsql',
'host' => $dbopts["host"],
'name' => ltrim($dbopts["path"],'/'),
'user' => $dbopts['user'],
'pass' => $dbopts['pass'],
'port' => $dbopts['port'],
'charset' => 'UTF-8'
]
]
];