Developers/Setup tasks

You want to implement a new feature in the Arcavias core or provide an Arcavias extension. Your code will be managed by Git or a similar version control system. What if your new code also needs a new or updated database structure? Just changing your local database via the MySQL command line or tools or PHPMyAdmin is not enough. The whole community would have to adapt your changes manually to their databases to make your feature work. Providing a plain MySQL script isn't sufficient either. There might be the need to migrate the existing data in the database from the old structure into the new one. This sometimes requires PHP code to convert the data.

The more general questions in this case are: How do you create the proper database structure that works for the corresponding commit in the Git repository? How can you update existing database structures in an automated way? The solution to this problems are setup tasks in the Arcavias context. They are PHP class files which perform all necessary updates to migrate the database structure from any version before during the setup. Setup tasks are a mechanism to store the database structure required along with the code in the version control system. At the same time they provide a way to store the instructions in the code to get from an old version to the new one.

Creating new setup tasks

 * Understanding setup tasks
 * Implementing setup tasks
 * Dummy example
 * SQL statements
 * Dependencies
 * Process the updates
 * Rules for setup tasks
 * Appendix: Setup task essentials