CREATE TABLE IF NOT EXISTS `%prefix%conditions` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`table_id` INT(10) UNSIGNED NULL DEFAULT NULL,
	`data` TEXT NOT NULL,
	PRIMARY KEY (`id`)
)
DEFAULT CHARSET=utf8
;

ALTER TABLE `%prefix%rows_history`
ADD COLUMN `updated` TIMESTAMP NULL DEFAULT NULL AFTER `created`
;

UPDATE `%prefix%rows_history` as rh1
  INNER JOIN `%prefix%rows_history` as rh2
    ON rh1.id = rh2.id
SET rh1.updated = rh2.created
WHERE rh1.updated IS NULL
;