| 369 | |
| 370 | == Migrations == |
| 371 | |
| 372 | A //migration// is a sequence of database operations that is executed exactly once in the lifetime of a particular DeepaMehta installation. You as a developer are responsible for equipping your plugin with the required migrations. Migrations serve several purposes: |
| 373 | |
| 374 | 1. Define the plugin's data model. That is, storing new topic type definitions and association type definitions in the database. E.g. a //Books// plugin might define the Book, Title, and Author types. |
| 375 | |
| 376 | 2. A newer version of your plugin might extend or modify the data model defined by the previous version of your plugin. The migration of the updated plugin change the stored type definitions //and// transforms existing content if necessary. |
| 377 | |
| 378 | 3. The application logic of a newer version of your plugin changes in a way it is not compatible anymore with the existing database content. The migration must transform the existing content then. |
| 379 | |
| 380 | So, the purpose expressed in points 2. and 3. is to make your plugin //upgradable//. That is, keeping existing database content //in-snyc// with the plugin logic. By providing the corresponding migrations you make your plugin //compatible// with the previous plugin version. |