You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL patches can only contain one or more valid SQL commands.
For example:
-- Remove deprecated column from news table
ALTER TABLE `news` DROP COLUMN `is_published`;
PHP file
PHP patches should start with <?php and after this line you can add all the PHP code you want. In this file you will also have the $this->db (Zend Db), $this->writer and $this->config objects available.
For example:
<?php
// Convert some id's
$this->writer->line('Start patch 1');
$sql = 'UPDATE `order` SET `total` = `total`+ 1;'
$this->db->query($sql);
Add comments to your patch files
DbPatch also checks for comments on the 1st line of your patch file (for PHP patch files it's the second line) and add those to the description field of the db_changelog table. Just make sure to start your patch file with some comment like this:
SQL
-- SQL Patch comment
# SQL Patch comment different notation