-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from SSchulze1989/develop
v 0.10.0
- Loading branch information
Showing
18 changed files
with
8,246 additions
and
9 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
USE LeagueDatabase; | ||
|
||
START TRANSACTION; | ||
|
||
-- pre migration | ||
-- safe the CarNumber values as ints | ||
|
||
CREATE TEMPORARY TABLE TmpResultRowsNumbers ( | ||
ResultRowId BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
CarNumber INT NOT NULL | ||
); | ||
|
||
INSERT INTO TmpResultRowsNumbers (ResultRowId, CarNumber) | ||
SELECT ResultRowId, CarNumber | ||
FROM ResultRows; | ||
|
||
CREATE TEMPORARY TABLE TmpScoredResultRowsNumbers ( | ||
ScoredResultRowId BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
CarNumber INT NOT NULL | ||
); | ||
|
||
INSERT INTO TmpScoredResultRowsNumbers (ScoredResultRowId, CarNumber) | ||
SELECT ScoredResultRowId, CarNumber | ||
FROM ScoredResultRows; | ||
|
||
-- post migration | ||
-- restore CarNumber values as string | ||
|
||
UPDATE ResultRows `rows` | ||
JOIN TmpResultRowsNumbers `numbers` | ||
ON `numbers`.ResultRowId=`rows`.ResultRowId | ||
SET `rows`.CarNumber = `numbers`.CarNumber; | ||
|
||
UPDATE ScoredResultRows `rows` | ||
JOIN TmpScoredResultRowsNumbers `numbers` | ||
ON `numbers`.ScoredResultRowId=`rows`.ScoredResultRowId | ||
SET `rows`.CarNumber = `numbers`.CarNumber; | ||
|
||
DROP TABLE TmpResultRowsNumbers; | ||
DROP TABLE TmpScoredResultRowsNumbers; | ||
|
||
ROLLBACK; |
Oops, something went wrong.