SponsorBlockServer/databases/_upgrade_sponsorTimes_7.sql

28 lines
923 B
MySQL
Raw Permalink Normal View History

2021-03-20 02:31:16 +01:00
BEGIN TRANSACTION;
/* Add Service field */
CREATE TABLE "sqlb_temp_table_7" (
"videoID" TEXT NOT NULL,
"startTime" REAL NOT NULL,
"endTime" REAL NOT NULL,
"votes" INTEGER NOT NULL,
2021-06-25 05:44:08 +02:00
"locked" INTEGER NOT NULL default '0',
"incorrectVotes" INTEGER NOT NULL default '1',
2021-03-20 02:31:16 +01:00
"UUID" TEXT NOT NULL UNIQUE,
"userID" TEXT NOT NULL,
"timeSubmitted" INTEGER NOT NULL,
"views" INTEGER NOT NULL,
"category" TEXT NOT NULL DEFAULT 'sponsor',
2021-06-25 05:44:08 +02:00
"service" TEXT NOT NULL DEFAULT 'YouTube',
2021-03-20 02:31:16 +01:00
"shadowHidden" INTEGER NOT NULL,
2021-06-25 05:44:08 +02:00
"hashedVideoID" TEXT NOT NULL default ''
2021-03-20 02:31:16 +01:00
);
INSERT INTO sqlb_temp_table_7 SELECT "videoID","startTime","endTime","votes","locked","incorrectVotes","UUID","userID","timeSubmitted","views","category",'YouTube', "shadowHidden","hashedVideoID" FROM "sponsorTimes";
DROP TABLE "sponsorTimes";
ALTER TABLE sqlb_temp_table_7 RENAME TO "sponsorTimes";
UPDATE "config" SET value = 7 WHERE key = 'version';
COMMIT;