My plugin's FieldType was initially setup with defineContentAttribte
set to false. I and switching it to AttributeType::Mixed
. Does a migration need to be written to account for this change? If so how would this be written since it is the specific input name that is added to the content table?
1 Answer
Does a migration need to be written to account for this change?
Yes.
how would this be written since it is the specific input name that is added to the content table?
Just thinking out loud:
Select all fields from the database that have your field type.
Determine if they are in a Matrix context (
craft_matrixHandleContent
) a global context (craft_content
).For each grab their handles and build the column name.
Alter table to add the column to the appropriate table.