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

2 lines
206 B
MySQL
Raw Permalink Normal View History

2022-09-13 09:44:00 +08:00
alter table `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);