You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can only call services that are explicitly listed under the `ibexa_migrations.callable_services` configuration key:
232
+
233
+
```yaml
234
+
ibexa_migrations:
235
+
callable_services:
236
+
- App\Migration\ContentImporter
237
+
```
238
+
212
239
### Expression syntax
213
240
214
241
You can use [Symfony expression syntax]([[= symfony_doc =]]/reference/formats/expression_language.html) in data migrations, like in [repeatable steps](#repeatable-steps), where you can use it to generate varied content in migration steps.
@@ -300,6 +327,7 @@ The following examples show what data you can import using data migrations.
300
327
The following example shows how to create a content type with two field definitions.
301
328
302
329
The required metadata keys are: `identifier`, `mainTranslation`, `contentTypeGroups` and `translations`.
330
+
The example also shows the optional metadata keys: `nameSchema`, `urlAliasSchema`, `container`, `defaultAlwaysAvailable`, `defaultSortField`, `defaultSortOrder`, `remoteId`, and `creatorId`.
303
331
304
332
The default values of field definition properties mirror the underlying PHP API, for example:
305
333
@@ -314,7 +342,8 @@ The default values of field definition properties mirror the underlying PHP API,
314
342
315
343
The following example shows how to create two content items: a folder and an article inside it.
316
344
317
-
When creating a content item, three metadata keys are required: `contentType`, `mainTranslation`, and `parentLocationId`.
345
+
When creating a content item, three metadata keys are required: `contentType`, `parentLocationId`, and `mainTranslation`.
346
+
The `mainTranslation` property sets content item's main language.
318
347
319
348
To use the location ID of the folder, which is created automatically by the system, you can use a [reference](managing_migrations.md#references).
320
349
In this case you assign the `parent_folder_location_id` reference name to the location ID, and then use it when creating the article.
@@ -323,6 +352,22 @@ In this case you assign the `parent_folder_location_id` reference name to the lo
The following example shows the optional `metadata` and `location` properties that you can set when creating a content item.
356
+
Instead of `parentLocationId`, you can identify the parent location with `parentLocationRemoteId`.
357
+
`sortField` takes the numeric value of one of the `SORT_FIELD_*` constants from the [`Location` class](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Location.html), and `sortOrder` takes `ASC` or `DESC`, case insensitive:
Copy file name to clipboardExpand all lines: docs/content_management/data_migration/managing_migrations.md
+26-7Lines changed: 26 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,17 +167,36 @@ The order of migration steps matters - they are executed sequentially from top t
167
167
filename: 'references/new_references.yaml'
168
168
```
169
169
170
+
You can also set a reference value manually with the `set` mode, and use the `list` mode to print all references collected so far to the migration log:
0 commit comments