share-platform/config/db/V2.5__tb_data_resource_addc...

9 lines
343 B
MySQL
Raw Normal View History

2022-06-29 09:08:42 +08:00
alter table `tb_data_resource` ADD COLUMN `total` int NULL comment '整体评分';
update tb_data_resource,
tb_data_resource_assignmark
SET tb_data_resource.total = round(tb_data_resource_assignmark.total)
WHERE
tb_data_resource.id = tb_data_resource_assignmark.id;
alter table `tb_data_resource`ADD INDEX `total`(`total` DESC) USING BTREE;