-- 2018-1-25
ALTER TABLE `user`
DROP COLUMN `level`,
ADD COLUMN `telephone`  varchar(20) NULL;

--2018-2-23
ALTER TABLE `ad_program_tv_data`
DROP COLUMN `audience_rating_18_45`,
DROP COLUMN `avg_num_18_45`,
ADD COLUMN `audience_rating_18_30_woman` double NULL,
ADD COLUMN `avg_num_18_30_woman` int(8) NULL,
ADD COLUMN `audience_rating_20_45_man` double NULL,
ADD COLUMN `avg_num_20_45_man` int(8) NULL,
ADD COLUMN `audience_rating_20_45` double NULL,
ADD COLUMN `avg_num_20_45` int(8) NULL,
ADD COLUMN `audience_rating` double NULL,
ADD COLUMN `avg_num` int(8) NULL;

--2018-4-28
--媒体资源库增加“联合唯一约束”
ALTER TABLE ad_resources_advertise ADD UNIQUE union_unique(`name`,`show_time`,`type`,`theater_attribute`)
ALTER TABLE ad_resources_play ADD UNIQUE union_unique(`channel`,`name`,`type`,`form`,`show_time`)
ALTER TABLE ad_resources_long ADD UNIQUE union_unique(`network_tv`,`name`,`type`,`form`,`ip`,`show_time`)
ALTER TABLE ad_resources_short ADD UNIQUE union_unique(`name`,`show_time`)
ALTER TABLE ad_resources_app ADD UNIQUE union_unique(`name`,`show_time`)
ALTER TABLE ad_resources_other ADD UNIQUE union_unique(`name`,`show_time`)

--2018-5-4
--添加短视频 app 其他资源 详情表

CREATE TABLE `ad_resources_app_info`

CREATE TABLE `ad_resources_other_info`

CREATE TABLE `ad_resources_short_info`

UPDATE TABLE ad_resources_play_info COLUMN infos INTO TEXT

UPDATE TABLE ad_resources_long_info COLUMN infos INTO TEXT

--2018-05-10
--需求变更。电视节目资源评分表的主表关联字段由 resource_id 变更为 resource_name
ALTER TABLE `ad_resources_play_score`
ADD COLUMN `resource_name`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '电视剧名称' AFTER `resource_id`;

--2018/05/10
--原数据长度不满足需求
ALTER TABLE `ad_resources_play`
MODIFY COLUMN `discount`  double(5,2) NULL DEFAULT NULL COMMENT '折扣' AFTER `price`;

--2018/05/10
--媒体资源库，取消时间的自动更新
ALTER TABLE `ad_resources_advertise`
MODIFY COLUMN `crt_time`  timestamp NULL DEFAULT NULL COMMENT '创建时间：默认值现在时间' AFTER `status`,
MODIFY COLUMN `upd_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间：默认值现在时间' AFTER `crt_time`;
ALTER TABLE `ad_resources_play`
MODIFY COLUMN `crt_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间：默认值现在时间' AFTER `status`,
MODIFY COLUMN `upd_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间' AFTER `crt_time`;
ALTER TABLE `ad_resources_play_score`
MODIFY COLUMN `crt_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间：默认值现在时间' AFTER `r_feel`,
MODIFY COLUMN `upd_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间' AFTER `crt_time`;
ALTER TABLE `ad_resources_app`
MODIFY COLUMN `crt_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间：默认值现在时间' AFTER `status`,
MODIFY COLUMN `upd_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间：默认值现在时间' AFTER `crt_time`;
ALTER TABLE `ad_resources_long`
MODIFY COLUMN `crt_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间：默认值现在时间' AFTER `status`,
MODIFY COLUMN `upd_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间' AFTER `crt_time`;
ALTER TABLE `ad_resources_long_score`
MODIFY COLUMN `crt_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间：默认值现在时间' AFTER `r_feel`,
MODIFY COLUMN `upd_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间' AFTER `crt_time`;
ALTER TABLE `ad_resources_other`
MODIFY COLUMN `crt_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间：默认值现在时间' AFTER `status`,
MODIFY COLUMN `upd_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间：默认值现在时间' AFTER `crt_time`;
ALTER TABLE `ad_resources_short`
MODIFY COLUMN `crt_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间：默认值现在时间' AFTER `status`,
MODIFY COLUMN `upd_time`  timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间：默认值现在时间' AFTER `crt_time`;







