

ALTER TABLE `page` CHANGE `type` `type` VARCHAR( 45 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '';

CREATE  TABLE IF NOT EXISTS `ads` (
  `id` INT(11) NOT NULL AUTO_INCREMENT ,
  `code` VARCHAR(45) NULL DEFAULT NULL ,
  `description` VARCHAR(45) NULL DEFAULT NULL ,
  `width` VARCHAR(15) NULL DEFAULT NULL ,
  `height` VARCHAR(15) NULL DEFAULT NULL ,
  `repository_id` INT(11) NULL DEFAULT NULL ,
  PRIMARY KEY (`id`) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;

ALTER TABLE `ads` ADD COLUMN `is_activated` TINYINT(1) NULL DEFAULT 1  AFTER `repository_id` ;
ALTER TABLE `ads` ADD COLUMN `is_hardlocked` TINYINT(1) NULL DEFAULT 0  AFTER `is_activated` ;
ALTER TABLE `ads` ADD COLUMN `is_random` TINYINT(1) NULL DEFAULT 0  AFTER `is_hardlocked` ;
ALTER TABLE `ads` ADD COLUMN `title` VARCHAR(45) NULL DEFAULT NULL  AFTER `code` , ADD COLUMN `category` VARCHAR(45) NULL DEFAULT NULL  AFTER `title` , ADD COLUMN `link` VARCHAR(160) NULL DEFAULT NULL  AFTER `height` ;
ALTER TABLE `ads` CHANGE COLUMN `category` `type` VARCHAR(45) NULL DEFAULT NULL  ;




