ALTER TABLE `rv_banners`
DROP COLUMN `rmptserverurl`,
DROP COLUMN `videofile`,
DROP COLUMN `videourl`,
DROP COLUMN `videofiletype`,
DROP COLUMN `duration`,
DROP COLUMN `clickurl`,
DROP COLUMN `viewurl`,
DROP COLUMN `landingurl`,
DROP COLUMN `trackingurl`,
DROP COLUMN `overlaytype`,
DROP COLUMN `overlayimage`,
DROP COLUMN `overlayswf`,
DROP COLUMN `overlaytxttitle`,
DROP COLUMN `overlaytxtdescription`,
DROP COLUMN `calltoaction`,
DROP COLUMN `overlayhtml`,
DROP COLUMN `overlayclickaction`,
MODIFY COLUMN `revenue`  decimal(11,4) NOT NULL DEFAULT 0.0000 AFTER `deliverymethod`,
MODIFY COLUMN `contenttype`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'gif' AFTER `revenue`;

ALTER TABLE `rv_banners`
MODIFY COLUMN `adgroupid`  int(11) NOT NULL AFTER `bannerid`,
MODIFY COLUMN `campaignid`  int(11) NOT NULL DEFAULT 0 AFTER `adgroupid`,
ADD COLUMN `clientid`  int(11) NOT NULL AFTER `campaignid`;


ALTER TABLE `rv_banners`
DROP COLUMN `bannergroup`,
DROP COLUMN `bannercategory1`,
DROP COLUMN `bannercategory2`,
DROP COLUMN `bannersubtype`,
DROP COLUMN `deliverymethod`,
DROP COLUMN `revenue`,
MODIFY COLUMN `bannertype`  int(2) NOT NULL DEFAULT 0 AFTER `clientid`,
MODIFY COLUMN `contenttype`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'gif' AFTER `bannertype`;


CREATE TABLE `rv_banner_vast_element_template` (
  `template_id` int(11) NOT NULL AUTO_INCREMENT,
  `banner_vast_element_id` int(11) DEFAULT NULL,
  `banner_id` int(11) DEFAULT NULL,
  `vast_element_type` varchar(20) NOT NULL DEFAULT '',
  `vast_video_id` varchar(255) DEFAULT NULL,
  `vast_video_duration` int(11) DEFAULT NULL,
  `vast_video_delivery` varchar(20) DEFAULT NULL,
  `vast_video_type` varchar(20) DEFAULT NULL,
  `vast_video_bitrate` varchar(20) DEFAULT NULL,
  `vast_video_height` int(11) DEFAULT NULL,
  `vast_video_width` int(11) DEFAULT NULL,
  `vast_video_outgoing_filename` text,
  `vast_companion_banner_id` int(11) DEFAULT NULL,
  `vast_overlay_height` int(11) DEFAULT NULL,
  `vast_overlay_width` int(11) DEFAULT NULL,
  `vast_video_clickthrough_url` text,
  `vast_overlay_action` varchar(20) DEFAULT NULL,
  `vast_overlay_format` varchar(20) DEFAULT NULL,
  `vast_overlay_text_title` text,
  `vast_overlay_text_description` text,
  `vast_overlay_text_call` text,
  `vast_creative_type` varchar(20) DEFAULT NULL,
  `vast_thirdparty_impression` text,
  `account_id` int(11) NOT NULL,
  `bannername` varchar(200) DEFAULT NULL,
  `bannergroup` varchar(200) DEFAULT NULL,
  `bannercategory1` int(4) DEFAULT NULL,
  `bannercategory2` int(4) DEFAULT NULL,
  `bannertype` int(4) DEFAULT NULL,
  `bannersubtype` int(4) DEFAULT NULL,
  `deliverymethod` int(4) DEFAULT NULL,
  `revenue` decimal(11,4) DEFAULT NULL,
  `comments` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`template_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE `rv_banner_vast_element`
ADD COLUMN `template_id`  int(11) NOT NULL,
ADD COLUMN `bannername`  varchar(200) NULL AFTER `vast_thirdparty_impression`,
ADD COLUMN `bannergroup`  varchar(200) NULL AFTER `bannername`,
ADD COLUMN `bannercategory1`  int(4) NULL AFTER `bannergroup`,
ADD COLUMN `bannercategory2`  int(4) NULL AFTER `bannercategory1`,
ADD COLUMN `bannertype`  int(4) NULL AFTER `bannercategory2`,
ADD COLUMN `bannersubtype`  int(4) NULL AFTER `bannertype`,
ADD COLUMN `deliverymethod`  int(4) NULL AFTER `bannersubtype`,
ADD COLUMN `revenue`  decimal(11,4) NULL AFTER `deliverymethod`,
ADD COLUMN `comments`  varchar(200) NULL AFTER `revenue`;