When I create a FieldtypeCombo using RockMigrations I get the following error when I try to add the combo to a page:
PagesEditor: Error saving field "Options" — SQLSTATE[42S22]: Column not found: 1054 Unknown column 'i1' in 'field list'
Here is the code I use to create the field:
$this->rm()->createField('wrapper_options', 'FieldtypeCombo', [
'tags' => self::TAG,
'label' => 'Options',
'flags' => '0',
'i1_label' => 'Tag Type',
'i1_name' => 'tag_type',
'i1_type' => 'Select',
'qty' => '4',
'hideWrap' => '0',
'collapsed' => '0',
'useColNames' => '0',
'modSchema' => '0',
'useDataCol' => '0',
'i1_options' => '+div
section',
'i1_ok' => '1',
'i1_collapsed' => '0',
'i1_columnWidth' => '25',
'order' => '1,2,3,4',
'i2_label' => 'Background',
'i2_name' => 'background',
'i2_type' => 'Select',
'i2_options' => '+None
Color
Gradient
Image',
'i2_ok' => '1',
'i2_collapsed' => '0',
'i2_columnWidth' => '25',
'i3_label' => 'Width',
'i3_name' => 'width',
'i3_type' => 'Select',
'i3_options' => '+Full Width
Max Width',
'i3_ok' => '1',
'i3_collapsed' => '0',
'i3_columnWidth' => '25',
'i4_label' => 'Spacing',
'i4_name' => 'spacing',
'i4_type' => 'Select',
'i4_options' => '+Padding
Margin',
'i4_ok' => '1',
'i4_collapsed' => '0',
'i4_columnWidth' => '25',
]);
If I edit the field using the PW admin dashboard, and then save it, the problem goes away. I.e. the field is created properly in the database.
Am I missing something when creating the field using RockMigrations?
Thank you