Autogenerated migration script includes invalid "type": "markdown" line

We had some changes that included a new markdown field. The autogenerated migration script included this code:

console.log(
‘Create Multiple-paragraph text field “Card Description” (card_description) in block model “\\uD83D\\uDC81 Speaker Spotlight” (speaker_spotlight)’,
);
await client.fields.create(‘fpLMqpz8S3G80CMeGrkjMQ’, {
id: ‘GPVELgr1RU21Z7jTyE3eaw’,
label: ‘Card Description’,
field_type: ‘text’,
api_key: ‘card_description’,
validators: {
required: {},
length: { max: 820 },
sanitized_html: { sanitize_before_validation: true },
},
appearance: {
addons: [ ],
editor: ‘markdown’,
parameters: {
toolbar: \[
‘bold’,
‘code’,
‘italic’,
‘link’,
‘ordered_list’,
‘strikethrough’,
‘unordered_list’,
\],
},
type: ‘markdown’,
},
default_value: ‘’,
});

This resulted in an error that the “type” key was not permitted. Removing the type: 'markdown' line solved the problem, and didn’t seem to introduce any issues.

Hello @fitzage,

This should be fixed in CLI version 3.1.7: https://github.com/datocms/cli/issues/40#issuecomment-3460843439

Could you please confirm whether you’re on that version or an older one?

Ah, well I should have checked that. Probably the source of my previous errors also. We’re still on 2.0.23. :grimacing:

1 Like