-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.php
160 lines (158 loc) · 7.42 KB
/
cli.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
use cyclone\dbdeploy;
return array(
'dbdeploy' => array(
'description' => 'Tool for database version controlling.',
'commands' => array(
'apply' => array(
'description' => 'Applies the changes not yet applied to the database.',
'arguments' => array(
'--revision' => array(
'alias' => '-r',
'descr' => 'the target revision',
'required' => FALSE,
'parameter' => '<revision-number>'
),
'--delta-set' => array(
'alias' => '-s',
'descr' => 'the delta set to be applied up to the target revision',
'required' => FALSE,
'parameter' => '<delta-set-name>'
),
'--changelog-table' => array(
'alias' => '-c',
'descr' => 'the nam eof the changelog table in the database which stores the applies revisions',
'required' => FALSE,
'parameter' => '<changelog-table-name>'
),
'--connection' => array(
'alias' => '-n',
'descr' => 'the name of the DB config (connection) to be used',
'required' => FALSE,
'parameter' => '<connection-name>'
),
'--src-dir' => array(
'alias' => '-d',
'descr' => 'the root directory of database revision files',
'required' => FALSE,
'default' => NULL,
'parameter' => '<path-to-sources>'
),
'--exec' => array(
'alias' => '-e',
'required' => FALSE,
'descr' => 'executes the created SQL script, not only writes to standard output',
'parameter' => NULL
),
'--quiet' => array(
'alias' => '-q',
'required' => FALSE,
'descr' => 'does not write the generated SQL script to the standard output',
'parameter' => NULL
)
),
'callback' => array(dbdeploy\CommandProcessor::factory('apply'), 'execute')
),
'revert' => array(
'description' => 'Reverts the database to a given revision.',
'arguments' => array(
'--revision' => array(
'alias' => '-r',
'descr' => 'the target revision number',
'required' => TRUE,
'parameter' => '<revision-number>'
),
'--delta-set' => array(
'alias' => '-s',
'descr' => 'the delta set to be reverted to the target revision',
'parameter' => '<delta-set-name>'
),
'--changelog-table' => array(
'alias' => '-c',
'descr' => 'the name of the changelog table in the database which stores the applies revisions',
'required' => FALSE,
'parameter' => '<changelog-table-name>'
),
'--connection' => array(
'alias' => '-n',
'descr' => 'the name of the DB config (connection) to be used',
'required' => FALSE,
'parameter' => '<connection-name>'
),
'--src-dir' => array(
'alias' => '-d',
'descr' => 'the root directory of database revision files',
'required' => FALSE,
'parameter' => '<path-to-sources>'
),
'--exec' => array(
'alias' => '-e',
'required' => FALSE,
'descr' => 'executes the created SQL script, not only writes to standard output',
'parameter' => NULL
),
'--quiet' => array(
'alias' => '-q',
'required' => FALSE,
'descr' => 'does not write the generated SQL script to the standard output',
'parameter' => NULL
)
),
'callback' => array(dbdeploy\CommandProcessor::factory('revert'), 'execute')
),
'diff' => array(
'description' => 'Shows diff between two revisions',
'arguments' => array(
'--revision' => array(
'alias' => '-r',
'descr' => 'the number of the two revisions to be diffed. These must be separated by 2 dots, eg: 5..6 or 15..7',
'required' => TRUE,
'parameter' => '<from..to>'
),
'--delta-set' => array(
'alias' => '-s',
'descr' => 'the delta set to be reverted to the target revision',
'required' => FALSE,
'parameter' => '<delta-set-name>'
),
'--changelog-table' => array(
'alias' => '-c',
'descr' => 'the name of the changelog table in the database which stores the applies revisions',
'required' => FALSE,
'default' => NULL,
'parameter' => '<changelog-table-name>'
),
'--connection' => array(
'alias' => '-n',
'descr' => 'the name of the DB config (connection) to be used',
'required' => FALSE,
'default' => 'default',
'parameter' => '<connection-name>'
),
'--src-dir' => array(
'alias' => '-d',
'descr' => 'the root directory of database revision files',
'required' => FALSE,
'default' => NULL,
'parameter' => '<path-to-sources>'
),
'--exec' => array(
'alias' => '-e',
'required' => FALSE,
'default' => FALSE,
'descr' => 'executes the created SQL script, not only writes to standard output',
'parameter' => NULL
),
'--quiet' => array(
'alias' => '-q',
'required' => FALSE,
'default' => FALSE,
'descr' => 'does not write the generated SQL script to the standard output',
'parameter' => NULL
)
),
'callback' => array(dbdeploy\CommandProcessor::factory('diff'), 'execute')
)
)
)
);