command($sql); $sql = <<command($sql); $sql = <<command($sql); // Add function to update timestamp column $sql = <<command($sql); // Add triggers for tables with timestamp columns foreach (array('entry', 'repeat', 'users') as $table) { $sql = "CREATE TRIGGER update_" . _tbl($table, false) . "_timestamp " . "BEFORE UPDATE ON " . _tbl($table, true) . " FOR EACH ROW " . "EXECUTE PROCEDURE update_timestamp_column()"; $upgrade_handle->command($sql); } }