I have been playing with data migrations but I canāt figure out how to copy a collection to another branch. I tried a simple test where I use the autogenerate migration script and it give errors.
For example here I am running autogenerated script for a migration from one branch to another::
$ dato migrate --source=example --inPlace --token=
Migrations will be run in sandbox env example
- Running 1669455966_addTestWithData.jsā¦
Create new models/block models
Create model āTestā (test
)
Warning: Attribute api_key should be expressed in camelCase syntax (apiKey)
Warning: Attribute all_locales_required should be expressed in camelCase syntax (allLocalesRequired)
Warning: Attribute collection_appearance should be expressed in camelCase syntax (collectionAppearance)
Creating new fields/fieldsets
Create Single-line string field āNameā (name
) in model āTestā (test
)
Warning: Attribute field_type should be expressed in camelCase syntax (fieldType)
Warning: Attribute api_key should be expressed in camelCase syntax (apiKey)
Warning: Attribute default_value should be expressed in camelCase syntax (defaultValue)
Command failed!
Failed request:
POST https://site-api.datocms.com/item-types/[object Object]/fields
content-type: application/json
accept: application/json
authorization: Bearer token
user-agent: js-client v3.5.21
X-Api-Version: 3
x-environment: example
{ādataā:{ātypeā:āfieldā,āattributesā:{ālabelā:āNameā,āfield_typeā:āstringā,āapi_keyā:ānameā,āappearanceā:{āaddonsā:[],āeditorā:āsingle_lineā,āparametersā:{āheadingā:false}},ādefault_valueā:āā}}}
HTTP Response:
404 Not Found
Anyway, any links to working code to simply copy a collection and itās data to another branch? Thanks.