AiJiNanProject/db/weiyan_20190423.sql
小黄狗横扫士力架 bfc6a73c2f first commit
2022-12-28 09:45:16 +08:00

16 lines
812 B
SQL

ALTER TABLE `live_scene`
ADD COLUMN `auditor_id` int(11) NULL DEFAULT NULL COMMENT '实际审核人Id',
ADD COLUMN `audit_date` datetime NULL DEFAULT NULL COMMENT '审核时间',
ADD COLUMN `channels_name` varchar(255) NULL DEFAULT NULL COMMENT '栏目名称(多选)';
DROP TABLE IF EXISTS `live_scene_channel`;
CREATE TABLE `live_scene_channel` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`scene_id` int(11) NOT NULL,
`channel_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='现场与栏目对应关系';
insert into live_scene_channel(scene_id,channel_id) select id,channel_id from live_scene bean where bean.channel_id is not NULL;
update live_scene a SET a.channels_name=(SELECT c.`name` FROM live_channel as c where c.id=a.channel_id)