Skip to content

Commit

Permalink
query: fix the date for repo recent queries (#1408)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mini256 authored Mar 21, 2023
1 parent 6ed1c6c commit 3710e46
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions configs/queries/analyze-recent-commits/template.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions configs/queries/analyze-recent-issues/template.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions configs/queries/analyze-recent-pull-requests/template.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions configs/queries/analyze-recent-stars/template.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 3710e46

Please sign in to comment.