Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Commit 3a6f244

Browse files
committed
add example for output
1 parent 91f0184 commit 3a6f244

File tree

1 file changed

+195
-19
lines changed

1 file changed

+195
-19
lines changed

rake/dkdeploy-php/db.md

Lines changed: 195 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,44 @@ set :migrations_default_arguments, ['--no-interaction']
1717

1818
### Usage
1919

20-
{% highlight shell %}
20+
{% highlight shell-session %}
2121
$ cap dev db:migrations:generate
2222
{% endhighlight %}
2323

2424
### Output
2525

26-
{% highlight shell %}
27-
TODO
26+
{% highlight shell-session %}
27+
00:00 db:migrations:copy_doctrine_to_server
28+
./vendor/doctrine-migrations.phar found.
29+
Removing old migrations.
30+
01 rm -rf /var/www/dkdeploy/shared/migrations
31+
✔ 01 [email protected] 0.593s
32+
Creating directories for migrations.
33+
02 mkdir -p /var/www/dkdeploy/shared/migrations/classes
34+
✔ 02 [email protected] 0.361s
35+
Copying doctrine-migrations.phar to /var/www/dkdeploy/shared/migrations directory.
36+
Uploading ./vendor/doctrine-migrations.phar 10.75%
37+
Uploading ./vendor/doctrine-migrations.phar 20.3%
38+
Uploading ./vendor/doctrine-migrations.phar 31.04%
39+
Uploading ./vendor/doctrine-migrations.phar 40.6%
40+
Uploading ./vendor/doctrine-migrations.phar 50.15%
41+
Uploading ./vendor/doctrine-migrations.phar 60.9%
42+
Uploading ./vendor/doctrine-migrations.phar 70.45%
43+
Uploading ./vendor/doctrine-migrations.phar 81.19%
44+
Uploading ./vendor/doctrine-migrations.phar 90.75%
45+
Uploading ./vendor/doctrine-migrations.phar 100.0%
46+
Copying db-configuration.php to /var/www/dkdeploy/shared/migrations.
47+
Downloading db_settings.dev.yaml 100.0%
48+
Uploading /var/www/dkdeploy/shared/migrations/cli-config.php 100.0%
49+
Uploading /var/www/dkdeploy/shared/migrations/migrations.yml 100.0%
50+
00:01 db:migrations:generate
51+
Generating new migration.
52+
01 mkdir -p /var/www/dkdeploy/shared/migrations
53+
✔ 01 [email protected] 0.008s
54+
02 /usr/bin/php doctrine-migrations.phar migrations:generate --no-interaction
55+
02 Generated new migration class to "/var/www/dkdeploy/shared/migrations/classes/Version20170419091311.php"
56+
✔ 02 [email protected] 0.055s
57+
Downloading config/migrations/classes/Version20170419091311.php 100.0%
2858
{% endhighlight %}
2959

3060
### Additional information
@@ -37,14 +67,59 @@ Show migration status
3767

3868
### Usage
3969

40-
{% highlight shell %}
70+
{% highlight shell-session %}
4171
$ cap dev db:migrations:status
4272
{% endhighlight %}
4373

4474
### Output
4575

46-
{% highlight shell %}
47-
TODO
76+
{% highlight shell-session %}
77+
00:00 db:migrations:copy_doctrine_to_server
78+
./vendor/doctrine-migrations.phar found.
79+
Removing old migrations.
80+
01 rm -rf /var/www/dkdeploy/shared/migrations
81+
✔ 01 [email protected] 0.584s
82+
Creating directories for migrations.
83+
02 mkdir -p /var/www/dkdeploy/shared/migrations/classes
84+
✔ 02 [email protected] 0.357s
85+
Copying doctrine-migrations.phar to /var/www/dkdeploy/shared/migrations directory.
86+
Uploading ./vendor/doctrine-migrations.phar 10.75%
87+
Uploading ./vendor/doctrine-migrations.phar 20.3%
88+
Uploading ./vendor/doctrine-migrations.phar 31.04%
89+
Uploading ./vendor/doctrine-migrations.phar 40.6%
90+
Uploading ./vendor/doctrine-migrations.phar 50.15%
91+
Uploading ./vendor/doctrine-migrations.phar 60.9%
92+
Uploading ./vendor/doctrine-migrations.phar 70.45%
93+
Uploading ./vendor/doctrine-migrations.phar 81.19%
94+
Uploading ./vendor/doctrine-migrations.phar 90.75%
95+
Uploading ./vendor/doctrine-migrations.phar 100.0%
96+
Copying db-configuration.php to /var/www/dkdeploy/shared/migrations.
97+
Downloading db_settings.dev.yaml 100.0%
98+
Uploading /var/www/dkdeploy/shared/migrations/cli-config.php 100.0%
99+
Uploading /var/www/dkdeploy/shared/migrations/migrations.yml 100.0%
100+
00:01 db:migrations:copy_migrations_to_server
101+
Uploading migrations to /var/www/dkdeploy/shared/migrations/classes.
102+
01 rm -rf /var/www/dkdeploy/shared/migrations/classes
103+
✔ 01 [email protected] 0.006s
104+
00:01 db:migrations:status
105+
Getting status of migrations.
106+
01 /usr/bin/php doctrine-migrations.phar migrations:status
107+
01
108+
01 == Configuration
109+
01
110+
01 >> Name: Doctrine TYPO3 Migrations
111+
01 >> Database Driver: pdo_mysql
112+
01 >> Database Name: dkdeploy_php
113+
01 >> Configuration Source: /var/www/dkdeploy/shared/migrations/migrations.yml
114+
01 >> Version Table Name: doctrine_migrations
115+
01 >> Migrations Namespace: DoctrineMigrations
116+
01 >> Migrations Directory: /var/www/dkdeploy/shared/migrations/classes
117+
01 >> Current Version: 0
118+
01 >> Latest Version: 0
119+
01 >> Executed Migrations: 0
120+
01 >> Available Migrations: 0
121+
01 >> New Migrations: 0
122+
✔ 01 [email protected] 0.051s
48123
{% endhighlight %}
49124

50125
### Additional information
@@ -63,21 +138,79 @@ set :migrations_default_arguments, ['--no-interaction']
63138

64139
### Usage
65140

66-
{% highlight shell %}
141+
{% highlight shell-session %}
67142
$ cap dev db:migrations:migrate
68143
{% endhighlight %}
69144

70145
### Output
71146

72-
{% highlight shell %}
73-
TODO
147+
{% highlight shell-session %}
148+
00:00 db:migrations:copy_doctrine_to_server
149+
./vendor/doctrine-migrations.phar found.
150+
Removing old migrations.
151+
01 rm -rf /var/www/dkdeploy/shared/migrations
152+
✔ 01 [email protected] 0.379s
153+
Creating directories for migrations.
154+
02 mkdir -p /var/www/dkdeploy/shared/migrations/classes
155+
✔ 02 [email protected] 0.379s
156+
Copying doctrine-migrations.phar to /var/www/dkdeploy/shared/migrations directory.
157+
Uploading ./vendor/doctrine-migrations.phar 10.75%
158+
Uploading ./vendor/doctrine-migrations.phar 20.3%
159+
Uploading ./vendor/doctrine-migrations.phar 31.04%
160+
Uploading ./vendor/doctrine-migrations.phar 40.6%
161+
Uploading ./vendor/doctrine-migrations.phar 50.15%
162+
Uploading ./vendor/doctrine-migrations.phar 60.9%
163+
Uploading ./vendor/doctrine-migrations.phar 70.45%
164+
Uploading ./vendor/doctrine-migrations.phar 81.19%
165+
Uploading ./vendor/doctrine-migrations.phar 90.75%
166+
Uploading ./vendor/doctrine-migrations.phar 100.0%
167+
Copying db-configuration.php to /var/www/dkdeploy/shared/migrations.
168+
Downloading db_settings.dev.yaml 100.0%
169+
Uploading /var/www/dkdeploy/shared/migrations/cli-config.php 100.0%
170+
Uploading /var/www/dkdeploy/shared/migrations/migrations.yml 100.0%
171+
00:01 db:migrations:copy_migrations_to_server
172+
Uploading migrations to /var/www/dkdeploy/shared/migrations/classes.
173+
01 rm -rf /var/www/dkdeploy/shared/migrations/classes
174+
✔ 01 [email protected] 0.008s
175+
Uploading migrations for stage dev to /var/www/dkdeploy/shared/migrations/classes.
176+
02 mkdir -p /var/www/dkdeploy/shared/migrations/classes
177+
✔ 02 [email protected] 0.005s
178+
Uploading config/migrations/stage/dev/Version22222222222222.php 100.0%
179+
Uploading config/migrations/stage/dev/Version33333333333333.php 100.0%
180+
00:01 db:migrations:migrate
181+
Migrating database.
182+
01 /usr/bin/php doctrine-migrations.phar migrations:migrate --no-interaction
183+
01
184+
01 Doctrine TYPO3 Migrations
185+
01
186+
01
187+
01 Migrating up to 33333333333333 from 0
188+
01
189+
01 ++ migrating 22222222222222
190+
01
191+
01 Migration 22222222222222 was executed but did not result in any SQL statements.
192+
01
193+
01 ++ migrated (0s)
194+
01
195+
01 ++ migrating 33333333333333
196+
01
197+
01 Migration 33333333333333 was executed but did not result in any SQL statements.
198+
01
199+
01 ++ migrated (0s)
200+
01
201+
01 ------------------------
202+
01
203+
01 ++ finished in 0
204+
01 ++ 2 migrations executed
205+
01 ++ 0 sql queries
206+
✔ 01 [email protected] 0.064s
207+
74208
{% endhighlight %}
75209

76210
### Additional information
77211

78212
This task will first call <a href="#copydoctrinetoserver">copy migration to server</a> and <a href="#copymigrationtoserver">copy doctrine to server</a>, so any configuration options in that task will also affect this one.
79213

80-
81214
## execute\_down
82215

83216
Downgrade database to a previous version
@@ -91,17 +224,61 @@ CAUTION: It may not be possible to downgrade cleanly. If e.g. a previous migrati
91224
set :migrations_default_arguments, ['--no-interaction']
92225
{% endhighlight %}
93226

94-
95227
### Usage
96228

97-
{% highlight shell %}
229+
Pass the targeting `migration_version` either as an argument (example in output section) or enter it interactively.
230+
231+
{% highlight shell-session %}
98232
$ cap dev db:migrations:execute_down
99233
{% endhighlight %}
100234

101235
### Output
102236

103-
{% highlight shell %}
104-
TODO
237+
{% highlight shell-session %}
238+
$ cap dev db:migrations:execute_down[33333333333333]
239+
00:00 db:migrations:copy_doctrine_to_server
240+
./vendor/doctrine-migrations.phar found.
241+
Removing old migrations.
242+
01 rm -rf /var/www/dkdeploy/shared/migrations
243+
✔ 01 [email protected] 0.381s
244+
Creating directories for migrations.
245+
02 mkdir -p /var/www/dkdeploy/shared/migrations/classes
246+
✔ 02 [email protected] 0.364s
247+
Copying doctrine-migrations.phar to /var/www/dkdeploy/shared/migrations directory.
248+
Uploading ./vendor/doctrine-migrations.phar 10.75%
249+
Uploading ./vendor/doctrine-migrations.phar 20.3%
250+
Uploading ./vendor/doctrine-migrations.phar 31.04%
251+
Uploading ./vendor/doctrine-migrations.phar 40.6%
252+
Uploading ./vendor/doctrine-migrations.phar 50.15%
253+
Uploading ./vendor/doctrine-migrations.phar 60.9%
254+
Uploading ./vendor/doctrine-migrations.phar 70.45%
255+
Uploading ./vendor/doctrine-migrations.phar 81.19%
256+
Uploading ./vendor/doctrine-migrations.phar 90.75%
257+
Uploading ./vendor/doctrine-migrations.phar 100.0%
258+
Copying db-configuration.php to /var/www/dkdeploy/shared/migrations.
259+
Downloading db_settings.dev.yaml 100.0%
260+
Uploading /var/www/dkdeploy/shared/migrations/cli-config.php 100.0%
261+
Uploading /var/www/dkdeploy/shared/migrations/migrations.yml 100.0%
262+
00:00 db:migrations:copy_migrations_to_server
263+
Uploading migrations to /var/www/dkdeploy/shared/migrations/classes.
264+
01 rm -rf /var/www/dkdeploy/shared/migrations/classes
265+
✔ 01 [email protected] 0.006s
266+
Uploading migrations for stage dev to /var/www/dkdeploy/shared/migrations/classes.
267+
02 mkdir -p /var/www/dkdeploy/shared/migrations/classes
268+
✔ 02 [email protected] 0.006s
269+
Uploading config/migrations/stage/dev/Version22222222222222.php 100.0%
270+
Uploading config/migrations/stage/dev/Version33333333333333.php 100.0%
271+
Uploading config/migrations/stage/dev/Version44444444444444.php 100.0%
272+
Migrating down to version 33333333333333
273+
03 /usr/bin/php doctrine-migrations.phar migrations:execute 33333333333333 --down --no-interaction
274+
03
275+
03 -- reverting 33333333333333
276+
03
277+
03 Migration 33333333333333 was executed but did not result in any SQL statements.
278+
03
279+
03 -- reverted (0.01s)
280+
✔ 03 [email protected] 0.062s
281+
105282
{% endhighlight %}
106283

107284
## copy\_doctrine\_to\_server
@@ -117,7 +294,7 @@ set :doctrine_phar, './vendor/doctrine-migrations.phar'
117294

118295
### Usage
119296

120-
{% highlight shell %}
297+
{% highlight shell-session %}
121298
$ cap dev db:migrations:copy_doctrine_to_server
122299
{% endhighlight %}
123300

@@ -159,14 +336,13 @@ Copies your Doctrine migrations to the server
159336

160337
### Usage
161338

162-
{% highlight shell %}
163-
$ cap dev db:migrations:copy_migrations_to_server
339+
{% highlight shell-session%}
340+
$ cap dev db:migrations:copy_migrations_to_server
164341
{% endhighlight %}
165342

166343
### Output
167344

168345
{% highlight shell-session %}
169-
db:migrations:copy_migrations_to_server
170346
Uploading migrations to {{site.data.constants.deploy.path}}shared/migrations/classes.
171347
01 rm -rf {{site.data.constants.deploy.path}}shared/migrations/classes
172348
01 {{site.data.constants.deploy.user}}@{{site.data.constants.deploy.host}} 0.397s
@@ -176,4 +352,4 @@ Uploading migrations for stage {{site.data.constants.deploy.stage}} to {{site.da
176352
02 mkdir -p {{site.data.constants.deploy.path}}shared/migrations/classes
177353
02 {{site.data.constants.deploy.user}}@{{site.data.constants.deploy.host}} 0.008s
178354
Uploading config/migrations/stage/{{site.data.constants.deploy.stage}}Version20120109171451.php 100.0%
179-
{% endhighlight %}
355+
{% endhighlight %}

0 commit comments

Comments
 (0)