-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using first day of the rando league week instead of week number
- Loading branch information
Showing
5 changed files
with
99 additions
and
43 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
DROP INDEX league_settings_unique_flag; | ||
DROP INDEX league_settings_unique_value; | ||
ALTER TABLE league_settings | ||
ADD COLUMN date DATE; | ||
UPDATE league_settings | ||
SET date = DATE( | ||
'2023-01-01', | ||
printf('%d days', (week_number - 1) * 7 - 3) | ||
) WHERE week_number > 40; | ||
UPDATE league_settings | ||
SET date = DATE( | ||
'2024-01-01', | ||
printf('%d days', (week_number - 1) * 7 - 3) | ||
) WHERE week_number < 40; | ||
ALTER TABLE league_settings DROP COLUMN week_number; | ||
CREATE UNIQUE INDEX "league_settings_unique_flag" ON "league_settings" ( | ||
"date", | ||
"name" | ||
); | ||
|
||
CREATE UNIQUE INDEX "league_settings_unique_value" ON "league_settings" ( | ||
"date", | ||
"value" | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE TABLE "league_settings" ( | ||
"data" DATE NOT NULL, | ||
"name" VARCHAR(255) NOT NULL, | ||
"value" VARCHAR(255) NOT NULL | ||
); | ||
|
||
CREATE UNIQUE INDEX "league_settings_unique_flag" ON "league_settings" ( | ||
"date", | ||
"name" | ||
); | ||
|
||
CREATE UNIQUE INDEX "league_settings_unique_value" ON "league_settings" ( | ||
"date", | ||
"value" | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters