2020-12-18 17:59:04 +00:00
|
|
|
BEGIN TRANSACTION;
|
|
|
|
-- New Columns
|
|
|
|
ALTER TABLE Accounts ADD BanReason TEXT DEFAULT '' NOT NULL;
|
2020-12-20 22:08:12 +00:00
|
|
|
ALTER TABLE RaceResults ADD RingCount INTEGER DEFAULT 0 NOT NULL;
|
|
|
|
ALTER TABLE RaceResults ADD Time INTEGER DEFAULT 0 NOT NULL;
|
2020-12-18 17:59:04 +00:00
|
|
|
-- Fix timestamps in Meta
|
|
|
|
INSERT INTO Meta (Key, Value) VALUES ('Created', 0);
|
|
|
|
INSERT INTO Meta (Key, Value) VALUES ('LastMigration', strftime('%s', 'now'));
|
|
|
|
UPDATE Meta SET Value = (SELECT Created FROM Meta WHERE Key = 'ProtocolVersion') Where Key = 'Created';
|
2020-12-20 01:39:35 +00:00
|
|
|
-- Get rid of 'Created' Column
|
2020-12-18 17:59:04 +00:00
|
|
|
CREATE TABLE Temp(Key TEXT NOT NULL UNIQUE, Value INTEGER NOT NULL);
|
|
|
|
INSERT INTO Temp SELECT Key, Value FROM Meta;
|
|
|
|
DROP TABLE Meta;
|
2020-12-20 22:08:12 +00:00
|
|
|
ALTER TABLE Temp RENAME TO Meta;
|
2020-12-18 17:59:04 +00:00
|
|
|
-- Update DB Version
|
|
|
|
UPDATE Meta SET Value = 2 WHERE Key = 'DatabaseVersion';
|
|
|
|
UPDATE Meta SET Value = strftime('%s', 'now') WHERE Key = 'LastMigration';
|
|
|
|
COMMIT;
|