From 3710e4660987314ed0a3665914650030225601ee Mon Sep 17 00:00:00 2001 From: Mini256 Date: Tue, 21 Mar 2023 22:50:59 +0800 Subject: [PATCH] query: fix the date for repo recent queries (#1408) --- configs/queries/analyze-recent-commits/template.sql | 4 ++-- configs/queries/analyze-recent-issues/template.sql | 4 ++-- configs/queries/analyze-recent-pull-requests/template.sql | 4 ++-- configs/queries/analyze-recent-stars/template.sql | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configs/queries/analyze-recent-commits/template.sql b/configs/queries/analyze-recent-commits/template.sql index f01676d3b0..9f32704e12 100644 --- a/configs/queries/analyze-recent-commits/template.sql +++ b/configs/queries/analyze-recent-commits/template.sql @@ -6,8 +6,8 @@ WITH RECURSIVE seq(idx, current_period_day, last_period_day) AS ( UNION ALL SELECT idx + 1 AS idx, - DATE_SUB(CURRENT_DATE(), INTERVAL idx + 1 day) AS current_period_day, - DATE_SUB(CURRENT_DATE(), INTERVAL idx + 1 + 28 day) AS last_period_day + DATE_SUB(CURRENT_DATE(), INTERVAL idx day) AS current_period_day, + DATE_SUB(CURRENT_DATE(), INTERVAL idx + 28 day) AS last_period_day FROM seq WHERE idx < 28 ), group_by_day AS ( diff --git a/configs/queries/analyze-recent-issues/template.sql b/configs/queries/analyze-recent-issues/template.sql index 4b4fe0a9da..f4e18d6474 100644 --- a/configs/queries/analyze-recent-issues/template.sql +++ b/configs/queries/analyze-recent-issues/template.sql @@ -6,8 +6,8 @@ WITH RECURSIVE seq(idx, current_period_day, last_period_day) AS ( UNION ALL SELECT idx + 1 AS idx, - DATE_SUB(CURRENT_DATE(), INTERVAL idx + 1 day) AS current_period_day, - DATE_SUB(CURRENT_DATE(), INTERVAL idx + 1 + 28 day) AS last_period_day + DATE_SUB(CURRENT_DATE(), INTERVAL idx day) AS current_period_day, + DATE_SUB(CURRENT_DATE(), INTERVAL idx + 28 day) AS last_period_day FROM seq WHERE idx < 28 ), opened_issues_group_by_day AS ( diff --git a/configs/queries/analyze-recent-pull-requests/template.sql b/configs/queries/analyze-recent-pull-requests/template.sql index 9f2ce908f7..0a7894da65 100644 --- a/configs/queries/analyze-recent-pull-requests/template.sql +++ b/configs/queries/analyze-recent-pull-requests/template.sql @@ -6,8 +6,8 @@ WITH RECURSIVE seq(idx, current_period_day, last_period_day) AS ( UNION ALL SELECT idx + 1 AS idx, - DATE_SUB(CURRENT_DATE(), INTERVAL idx + 1 day) AS current_period_day, - DATE_SUB(CURRENT_DATE(), INTERVAL idx + 1 + 28 day) AS last_period_day + DATE_SUB(CURRENT_DATE(), INTERVAL idx day) AS current_period_day, + DATE_SUB(CURRENT_DATE(), INTERVAL idx + 28 day) AS last_period_day FROM seq WHERE idx < 28 ), opened_prs_group_by_day AS ( diff --git a/configs/queries/analyze-recent-stars/template.sql b/configs/queries/analyze-recent-stars/template.sql index 0dcd343ec2..5e06d4f50a 100644 --- a/configs/queries/analyze-recent-stars/template.sql +++ b/configs/queries/analyze-recent-stars/template.sql @@ -6,8 +6,8 @@ WITH RECURSIVE seq(idx, current_period_day, last_period_day) AS ( UNION ALL SELECT idx + 1 AS idx, - DATE_SUB(CURRENT_DATE(), INTERVAL idx + 1 day) AS current_period_day, - DATE_SUB(CURRENT_DATE(), INTERVAL idx + 1 + 28 day) AS last_period_day + DATE_SUB(CURRENT_DATE(), INTERVAL idx day) AS current_period_day, + DATE_SUB(CURRENT_DATE(), INTERVAL idx + 28 day) AS last_period_day FROM seq WHERE idx < 28 ), group_by_day AS (