-
Notifications
You must be signed in to change notification settings - Fork 75
/
phinx.php
executable file
·52 lines (48 loc) · 1.77 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
49
50
51
52
<?php
defined('SWOOLE_VERSION') or define('SWOOLE_VERSION', intval(phpversion('swoole')));
defined('EASYSWOOLE_ROOT') or define('EASYSWOOLE_ROOT', realpath(getcwd()));
defined('EASYSWOOLE_SERVER') or define('EASYSWOOLE_SERVER', 1);
defined('EASYSWOOLE_WEB_SERVER') or define('EASYSWOOLE_WEB_SERVER', 2);
defined('EASYSWOOLE_WEB_SOCKET_SERVER') or define('EASYSWOOLE_WEB_SOCKET_SERVER', 3);
require_once __DIR__ . '/vendor/autoload.php';
$databaseConfig = require_once "./dev.php";
define('PHINX_PRE', $databaseConfig['MYSQL']['prefix']);
return
[
'paths' => [
'migrations' => EASYSWOOLE_ROOT.'/database/migrations',
'seeds' => EASYSWOOLE_ROOT.'/database/seeds'
],
'environments' => [
'default_migration_table' => PHINX_PRE.'migrate_logs',
'default_environment' => 'development',
'production' => [
'adapter' => 'mysql',
'host' => 'localhost',
'name' => 'production_db',
'user' => 'root',
'pass' => '',
'port' => '3306',
'charset' => 'utf8',
],
'development' => [
'adapter' => 'mysql',
'host' => $databaseConfig['MYSQL']['host'],
'name' => $databaseConfig['MYSQL']['database'],
'user' => $databaseConfig['MYSQL']['user'],
'pass' => $databaseConfig['MYSQL']['password'],
'port' => $databaseConfig['MYSQL']['port'],
'charset' => $databaseConfig['MYSQL']['charset'],
],
'testing' => [
'adapter' => 'mysql',
'host' => 'localhost',
'name' => 'testing_db',
'user' => 'root',
'pass' => '',
'port' => '3306',
'charset' => 'utf8',
]
],
'version_order' => 'creation'
];