CREATE TABLE IF NOT EXISTS `bfcms_revision` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `revision` smallint(6) NOT NULL DEFAULT '1',
  `primary` int(10) unsigned DEFAULT NULL,
  `table` varchar(64) DEFAULT NULL,
  `root_id` int(10) unsigned DEFAULT NULL,
  `model` varchar(64) DEFAULT NULL,
  `rows` longtext,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


ALTER TABLE `bfcms_cell` 
   DROP COLUMN `revision`, 
   ADD COLUMN `created_by` VARCHAR(128) NULL DEFAULT NULL  AFTER `placeable`, 
   ADD COLUMN `e_char1` VARCHAR(64) NULL DEFAULT NULL  AFTER `preferred_target`, 
   ADD COLUMN `e_char2` VARCHAR(64) NULL DEFAULT NULL  AFTER `e_char1`, 
   ADD COLUMN `e_char3` VARCHAR(255) NULL DEFAULT NULL  AFTER `e_char2`, 
   ADD COLUMN `e_char4` VARCHAR(255) NULL DEFAULT NULL  AFTER `e_char3`, 
   ADD COLUMN `e_dec1` DECIMAL(12,2) NULL DEFAULT 0  AFTER `e_char4`, 
   ADD COLUMN `e_dec2` DECIMAL(12,2) NULL DEFAULT 0  AFTER `e_dec1`, 
   ADD COLUMN `e_flag1` TINYINT(1) NULL DEFAULT 0  AFTER `e_dec2`, 
   ADD COLUMN `e_flag2` TINYINT(1) NULL  AFTER `e_flag1` , 
   ADD COLUMN `e_int1` INT NULL DEFAULT 0  AFTER `e_char4` , 
   ADD COLUMN `e_int2` INT NULL DEFAULT 0  AFTER `e_int1` , 
   ADD COLUMN `e_text1` MEDIUMTEXT NULL  AFTER `e_char4` , 
   ADD COLUMN `e_text2` MEDIUMTEXT NULL  AFTER `e_text1` , 
   CHANGE COLUMN `params` `params` LONGTEXT NULL DEFAULT NULL  , 
   CHANGE COLUMN `modified_by` `modified_by` VARCHAR(128) NULL DEFAULT NULL, 

   DROP PRIMARY KEY, 
   ADD PRIMARY KEY (`id`) ;


DROP TABLE `bfcms_cell_rev`;
DROP VIEW `bfcms_cell_rev_view`;

