Skip to content

Commit 89ff232

Browse files
authored
Feature: TYPO3 update schema task (#4117)
* Add typo3:database:updateschema task * update doc * update and generate docs
1 parent b943819 commit 89ff232

File tree

2 files changed

+52
-18
lines changed

2 files changed

+52
-18
lines changed

docs/recipe/typo3.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ The [deploy](#deploy) task of **TYPO3** consists of:
3737
* [deploy:writable](/docs/recipe/deploy/writable.md#deploy-writable) – Makes writable dirs
3838
* [deploy:vendors](/docs/recipe/deploy/vendors.md#deploy-vendors) – Installs vendors
3939
* [typo3:cache:warmup](/docs/recipe/typo3.md#typo3-cache-warmup) – TYPO3 - Cache warmup for system caches
40+
* [typo3:database:updateschema](/docs/recipe/typo3.md#typo3-database-updateschema) – TYPO3 - Update database schema
4041
* [typo3:extension:setup](/docs/recipe/typo3.md#typo3-extension-setup) – TYPO3 - Set up all extensions
4142
* [typo3:language:update](/docs/recipe/typo3.md#typo3-language-update) – TYPO3 - Update the language files of all activated extensions
4243
* [typo3:cache:flush](/docs/recipe/typo3.md#typo3-cache-flush) – TYPO3 - Clear all caches
@@ -169,7 +170,7 @@ Composer install options for production.
169170

170171

171172
### use_rsync
172-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L118)
173+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L117)
173174

174175
If set in the config this recipe uses rsync.
175176
Default setting: false (uses the Git repository)
@@ -180,7 +181,7 @@ false
180181

181182

182183
### update_code_task
183-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L120)
184+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L119)
184185

185186

186187

@@ -190,7 +191,7 @@ return get('use_rsync') ? 'rsync' : 'deploy:update_code';
190191

191192

192193
### rsync
193-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L148)
194+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L147)
194195

195196

196197

@@ -210,19 +211,30 @@ return get('use_rsync') ? 'rsync' : 'deploy:update_code';
210211
```
211212

212213

214+
### typo3_updateschema_types
215+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L164)
216+
217+
List of schema update types.
218+
`safe` includes all necessary operations, to add or change fields or tables.
219+
220+
```php title="Default value"
221+
'safe'
222+
```
223+
224+
213225

214226
## Tasks
215227

216228
### typo3\:update_code {#typo3-update_code}
217-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L124)
229+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L123)
218230

219231

220232

221233

222234

223235

224236
### typo3\:cache\:flush {#typo3-cache-flush}
225-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L168)
237+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L173)
226238

227239
TYPO3 - Clear all caches.
228240

@@ -231,31 +243,39 @@ All run via [bin/php](/docs/recipe/common.md#bin/php) [release_path](/docs/recip
231243

232244

233245
### typo3\:cache\:warmup {#typo3-cache-warmup}
234-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L173)
246+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L178)
235247

236248
TYPO3 - Cache warmup for system caches.
237249

238250

239251

240252

241253
### typo3\:language\:update {#typo3-language-update}
242-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L178)
254+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L183)
243255

244256
TYPO3 - Update the language files of all activated extensions.
245257

246258

247259

248260

249261
### typo3\:extension\:setup {#typo3-extension-setup}
250-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L183)
262+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L188)
251263

252264
TYPO3 - Set up all extensions.
253265

254266

255267

256268

269+
### typo3\:database\:updateschema {#typo3-database-updateschema}
270+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L193)
271+
272+
TYPO3 - Update database schema.
273+
274+
275+
276+
257277
### deploy {#deploy}
258-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L203)
278+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3.php#L214)
259279

260280
Deploys a TYPO3 project.
261281

@@ -268,10 +288,11 @@ Main deploy task for TYPO3.
268288
5. Ensure writable dirs
269289
6. Install vendors
270290
7. Warm up TYPO3 caches
271-
8. Run extension setup
272-
9. Update language files
273-
10. Flush caches
274-
11. Unlock and clean up
291+
8. Perform schema updates
292+
9. Run extension setup
293+
10. Update language files
294+
11. Flush caches
295+
12. Unlock and clean up
275296

276297

277298
This task is group task which contains next tasks:
@@ -284,6 +305,7 @@ This task is group task which contains next tasks:
284305
* [deploy:writable](/docs/recipe/deploy/writable.md#deploy-writable)
285306
* [deploy:vendors](/docs/recipe/deploy/vendors.md#deploy-vendors)
286307
* [typo3:cache:warmup](/docs/recipe/typo3.md#typo3-cache-warmup)
308+
* [typo3:database:updateschema](/docs/recipe/typo3.md#typo3-database-updateschema)
287309
* [typo3:extension:setup](/docs/recipe/typo3.md#typo3-extension-setup)
288310
* [typo3:language:update](/docs/recipe/typo3.md#typo3-language-update)
289311
* [typo3:cache:flush](/docs/recipe/typo3.md#typo3-cache-flush)

recipe/typo3.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
*/
111111
set('composer_options', ' --no-dev --verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader');
112112

113-
114113
/**
115114
* If set in the config this recipe uses rsync.
116115
* Default setting: false (uses the Git repository)
@@ -158,6 +157,12 @@
158157
'timeout' => 600,
159158
]);
160159

160+
/**
161+
* List of schema update types.
162+
* `safe` includes all necessary operations, to add or change fields or tables.
163+
*/
164+
set('typo3_updateschema_types', 'safe');
165+
161166

162167
/**
163168
* TYPO3 Commands
@@ -184,6 +189,11 @@
184189
run('{{bin/php}} {{release_path}}/{{bin/typo3}} extension:setup');
185190
});
186191

192+
desc('TYPO3 - Update database schema');
193+
task('typo3:database:updateschema', function () {
194+
run('{{bin/php}} {{release_path}}/{{bin/typo3}} database:updateschema {{typo3_updateschema_types}}');
195+
});
196+
187197
/**
188198
* Main deploy task for TYPO3.
189199
*
@@ -194,10 +204,11 @@
194204
* 5. Ensure writable dirs
195205
* 6. Install vendors
196206
* 7. Warm up TYPO3 caches
197-
* 8. Run extension setup
198-
* 9. Update language files
199-
* 10. Flush caches
200-
* 11. Unlock and clean up
207+
* 8. Perform schema updates
208+
* 9. Run extension setup
209+
* 10. Update language files
210+
* 11. Flush caches
211+
* 12. Unlock and clean up
201212
*/
202213
desc('Deploys a TYPO3 project');
203214
task('deploy', [
@@ -210,6 +221,7 @@
210221
'deploy:writable',
211222
'deploy:vendors',
212223
'typo3:cache:warmup',
224+
'typo3:database:updateschema',
213225
'typo3:extension:setup',
214226
'typo3:language:update',
215227
'typo3:cache:flush',

0 commit comments

Comments
 (0)