Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Db: Fix current week timeframe end #246

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion library/Reporting/ProvidedHook/DbMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public function providedDescriptions(): array
. ' engine of some tables.'
),
'0.10.0' => $this->translate('Creates the template table and adjusts some column types'),
'1.0.0' => $this->translate('Migrates all your configured report schedules to the new config.')
'1.0.0' => $this->translate('Migrates all your configured report schedules to the new config.'),
'1.1.0' => $this->translate('Fix the `end` time of preconfigured `Current Week` timeframe.'),
];
}

Expand Down
4 changes: 4 additions & 0 deletions schema/mysql-upgrades/1.1.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
UPDATE timeframe SET end = 'now' WHERE name = 'Current Week';
sukhwinder33445 marked this conversation as resolved.
Show resolved Hide resolved

INSERT INTO reporting_schema (version, timestamp, success, reason)
VALUES ('1.1.0', unix_timestamp() * 1000, 'y', NULL);
2 changes: 1 addition & 1 deletion schema/mysql.schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ INSERT INTO timeframe (name, title, start, end, ctime, mtime) VALUES
('One Year', null, '-1 year', 'now', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('Current Day', null, 'midnight', 'now', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('Last Day', null, 'yesterday midnight', 'yesterday 23:59:59', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('Current Week', null, 'monday this week midnight', 'sunday this week 23:59:59', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('Current Week', null, 'monday this week midnight', 'now', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('Last Week', null, 'monday last week midnight', 'sunday last week 23:59:59', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('Current Month', null, 'first day of this month midnight', 'now', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('Last Month', null, 'first day of last month midnight', 'last day of last month 23:59:59', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
Expand Down
4 changes: 4 additions & 0 deletions schema/pgsql-upgrades/1.1.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
UPDATE timeframe SET end = 'now' WHERE name = 'Current Week';
raviks789 marked this conversation as resolved.
Show resolved Hide resolved

INSERT INTO reporting_schema (version, timestamp, success, reason)
VALUES ('1.1.0', unix_timestamp() * 1000, 'y', NULL);
2 changes: 1 addition & 1 deletion schema/pgsql.schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ INSERT INTO timeframe (name, title, start, "end") VALUES
('One Year', null, '-1 year', 'now'),
('Current Day', null, 'midnight', 'now'),
('Last Day', null, 'yesterday midnight', 'yesterday 23:59:59'),
('Current Week', null, 'monday this week midnight', 'sunday this week 23:59:59'),
('Current Week', null, 'monday this week midnight', 'now'),
('Last Week', null, 'monday last week midnight', 'sunday last week 23:59:59'),
('Current Month', null, 'first day of this month midnight', 'now'),
('Last Month', null, 'first day of last month midnight', 'last day of last month 23:59:59'),
Expand Down
Loading