share-platform/config/db/V3.2__resource_add_col.sql

2 lines
223 B
MySQL
Raw Normal View History

alter table `share_platform`.`tb_data_resource` ADD COLUMN `visitor` bigint NULL comment '浏览量';
UPDATE tb_data_resource SET visitor = (SELECT COUNT(id) FROM tb_resource_browse WHERE resource_id = tb_data_resource.id);