1

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 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.