If you have a plugin installed with its own tables and you want to add some extra database fields to the table, what is the process for this?

Craft will create database tables using records on installation of the plugin, but what about after this? If I update the record definitions is there a way to trigger Craft to update the table or do I have to add the fields through MySQL?


If you want to change database schema after a plugin has already been installed, the way to do it is through migrations.

You can see many examples of this in Craft in the craft/app/migrations folder.

  • Oh you have migrations built right into your plugin system! That's so clever I didn't think to check for it! Thanks Brad! – JamesNZ Dec 12 '16 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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