fix: prevent future article timestamps from pinning feeds
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
-- 修复明显晚于文章入库时间的异常发布时间。
|
||||
-- 条件以创建时间后 2 天为容差,兼容数据源与数据库时区差异;重复执行不会再次命中。
|
||||
UPDATE `la_article`
|
||||
SET `published_at` = DATE_FORMAT(FROM_UNIXTIME(create_time), '%Y-%m-%d %H:%i:%s')
|
||||
WHERE `create_time` IS NOT NULL
|
||||
AND `published_at` REGEXP '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$'
|
||||
AND STR_TO_DATE(`published_at`, '%Y-%m-%d %H:%i:%s')
|
||||
> DATE_ADD(FROM_UNIXTIME(create_time), INTERVAL 2 DAY);
|
||||
Reference in New Issue
Block a user