-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphinx.php
48 lines (45 loc) · 2.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
45
46
47
48
<?php
require_once './vendor/autoload.php';
// Instantiate the app
$config = require __DIR__ . '/application/configs/config.php';
$app = new \Slim\App($settings);
// Set up dependencies
require __DIR__ . '/application/configs/dependencies.php';
return
[
'paths' => [
'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations',
'seeds' => '%%PHINX_CONFIG_DIR%%/db/seeds'
],
'environments' => [
'default_migration_table' => 'phinxlog',
'default_database' => 'development',
'development' => [
'name' => $settings['settings']['database']['database'],
'connection' => $container->get('db')->getConnection()->getPdo(),
],
'production' => [
'adapter' => $settings['settings']['database']['driver'],
'host' => $settings['settings']['database']['host'],
'name' => $settings['settings']['database']['database'],
'user' => $settings['settings']['database']['username'],
'pass' => $settings['settings']['database']['password'],
'port' => $settings['settings']['database']['port'],
'charset' => $settings['settings']['database']['charset'],
'collation' => $settings['settings']['database']['collation'],
'prefix' => $settings['settings']['database']['prefix'],
],
'testing' => [
'adapter' => $settings['settings']['database']['driver'],
'host' => $settings['settings']['database']['host'],
'name' => $settings['settings']['database']['database'],
'user' => $settings['settings']['database']['username'],
'pass' => $settings['settings']['database']['password'],
'port' => $settings['settings']['database']['port'],
'charset' => $settings['settings']['database']['charset'],
'collation' => $settings['settings']['database']['collation'],
'prefix' => $settings['settings']['database']['prefix'],
]
],
'version_order' => 'creation'
];