Answers.Body: <p>If you want to change database schema after a plugin has already been installed, the way to do it is through <a href="https://craftcms.com/docs/plugins/migrations" rel="nofollow noreferrer">migrations</a>.</p>
  
  <p>You can see many examples of this in Craft in the <code>craft/app/migrations</code> folder.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-12T23:03:43.167Z
Answers.Text: Oh you have migrations built right into your plugin system! That's so clever I didn't think to check for it! Thanks Brad!
Answers.UserDisplayName: JamesNZ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-12T22:41:43.240Z
Answers.LastActivityDate: 2016-12-12T22:41:43.240Z
Answers.UserDisplayName: Brad Bell
Body: <p>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?</p>
  
  <p>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?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-12T23:04:11.293Z
Comments.Text: Following on from Brad's answer, here's a link to the docs for migrations: https://craftcms.com/docs/plugins/migrations
Comments.UserDisplayName: JamesNZ
Tags: <plugin-development><plugins><records><mysql>
Title: Update record definition after plugin is already installed
ThreadText: # Update record definition after plugin is already installed
  
  (Asked by: username_0 on 2016-12-12)
  
  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?
  
  **Tags:** plugin-development, plugins, records, mysql
  
  > **Comments:**
  > **username_0**: Following on from username_1's answer, here's a link to the docs for migrations: https://craftcms.com/docs/plugins/migrations  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-12-12. Score: 2 | Accepted answer
  
  If you want to change database schema after a plugin has already been installed, the way to do it is through [migrations](https://craftcms.com/docs/plugins/migrations).
  
  You can see many examples of this in Craft in the `craft/app/migrations` folder.
  
  > **Comments:**
  > **username_0**: Oh you have migrations built right into your plugin system! That's so clever I didn't think to check for it! Thanks username_1!  
  
  ---
  
  