Developers/Setup tasks/Implementation/Process the updates

The setup tasks are prepared to work with different database types even within the same task. Therefore, the method _mysql is called if the database is a MySQL database and _pgsql would be called for PostgreSQL databases. Even if the SQL statements differ from database to database, the code required to execute the SQL statements is most often the same. This is the reason why it's a good idea to implement a separate _process method which receives the right statements for the actual database:

Note: Currently, only the _mysql method is supported.

Simple example
The first thing the _process method should do is to print what will happen next, e.g. what the setup task was written for. If only one column in one table should be added, changed or removed, the tests must be next. In both cases, the status of the test or execution of the statements should be printed:

Note: Please keep the output of _msg short. It shouldn't be more than 80 characters.

Complex example
Also printing what will happen next should be the first thing and now you need to and a call to $this->_status immediately. Otherwise, the output will be screwed up. If more than one column in several tables should be added, changed or removed, you must loop over the associative array given via the $stmts parameter in _process (see the SQL statements section for details). For each table/column combination you should print what will be tested. The status of the test or execution of the statements should be printed afterwards like before:

Note: The second parameter of the _msg method indents the output. In the first call it's not indented, but the following calls create an output that is indented by two spaces.

<< Previous: Implementation - Dependencies | Next: Implementation - Rules for setup tasks >>