-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphinx.php
44 lines (35 loc) · 1.01 KB
/
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
35
36
37
38
39
40
41
42
43
44
<?php
$settings = include(__DIR__ . '/config/settings.php');
$config = $settings['database'];
if ('app.sq3' == $config['name'] && 'sqlite' != substr($config['dsn'], 0, 6)) {
preg_match('~dbname=([^;]*)(?:;|$)~', $config['dsn'], $matches);
$config['name'] = $matches[1];
}
return [
// General settings
'version_order' => 'creation',
// File paths
'paths' => [
'migrations' => [
__DIR__ . '/resources/database/migrations',
],
'seeds' => [
__DIR__ . '/resources/database/seeds',
],
],
'environments' => [
// Phinx defaults
'default_migration_table' => 'phinxlog',
'default_database' => 'default',
// Database definition
'default' => [
'name' => $config['name'],
'connection' => new PDO(
$config['dsn'],
$config['username'],
$config['password'],
$config['options']
),
],
],
];