ALTER TABLE `rv_campaigns`
DROP COLUMN `period_schedule`,
DROP COLUMN `schedule_impression`,
DROP COLUMN `schedule_click`,
DROP COLUMN `period_actual`,
DROP COLUMN `actual_impression`,
DROP COLUMN `actual_click`,
ADD COLUMN `daily_impression`  int(11) NOT NULL DEFAULT 0 AFTER `target_conversion`,
ADD COLUMN `daily_click`  int(11) NOT NULL DEFAULT 0 AFTER `daily_impression`,
ADD COLUMN `daily_conversion`  int(11) NOT NULL DEFAULT 0 AFTER `daily_click`,
ADD COLUMN `target_impression_type`  int(2) NULL AFTER `daily_conversion`,
ADD COLUMN `target_impression_view`  int(11) NULL DEFAULT 0 AFTER `target_impression_type`,
ADD COLUMN `target_click_type`  int(2) NULL AFTER `target_impression_view`,
ADD COLUMN `target_click_view`  int(11) NULL DEFAULT 0 AFTER `target_click_type`,
MODIFY COLUMN `totalbudget`  decimal(18,4) NULL DEFAULT NULL AFTER `comments`,
MODIFY COLUMN `dailybudget`  decimal(18,4) NULL DEFAULT NULL AFTER `totalbudget`;


ALTER TABLE `rv_adgroups`
DROP COLUMN `period_schedule`,
DROP COLUMN `schedule_impression`,
DROP COLUMN `schedule_click`,
DROP COLUMN `target_audience`,
DROP COLUMN `target_geog`,
DROP COLUMN `target_hour`,
DROP COLUMN `target_os`,
DROP COLUMN `target_browser`,
DROP COLUMN `target_domain`,
DROP COLUMN `target_language`,
MODIFY COLUMN `totalbudget`  decimal(18,4) NULL DEFAULT NULL AFTER `expire_time`,
MODIFY COLUMN `dailybudget`  decimal(18,4) NULL DEFAULT NULL AFTER `totalbudget`,
ADD COLUMN `daily_impression`  int(11) NOT NULL DEFAULT 0 AFTER `target_conversion`,
ADD COLUMN `daily_click`  int(11) NOT NULL DEFAULT 0 AFTER `daily_impression`,
ADD COLUMN `daily_conversion`  int(11) NOT NULL DEFAULT 0 AFTER `daily_click`,
MODIFY COLUMN `status`  int(2) NULL DEFAULT NULL AFTER `session_capping`;

ALTER TABLE `rv_adgroups`
DROP COLUMN `target_impression`,
DROP COLUMN `target_click`,
DROP COLUMN `target_conversion`,
MODIFY COLUMN `daily_impression`  int(11) NOT NULL DEFAULT 0 AFTER `conversions`;

ALTER TABLE `rv_adgroups`
ADD COLUMN `campaignid`  int(11) NOT NULL AFTER `adgroupname`;
