SponsorBlockServer/databases/_upgrade_sponsorTimes_12.sql

31 lines
1.1 KiB
MySQL
Raw Normal View History

2021-05-23 23:54:51 +02:00
BEGIN TRANSACTION;
2021-05-24 18:46:39 +02:00
/* Add reputation field */
2021-05-23 23:54:51 +02:00
CREATE TABLE "sqlb_temp_table_12" (
"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-05-23 23:54:51 +02: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',
"videoDuration" REAL NOT NULL DEFAULT '0',
"hidden" INTEGER NOT NULL DEFAULT '0',
"reputation" REAL NOT NULL DEFAULT 0,
2021-05-23 23:54:51 +02:00
"shadowHidden" INTEGER NOT NULL,
2021-06-25 05:44:08 +02:00
"hashedVideoID" TEXT NOT NULL default ''
2021-05-23 23:54:51 +02:00
);
INSERT INTO sqlb_temp_table_12 SELECT "videoID","startTime","endTime","votes","locked","incorrectVotes","UUID","userID","timeSubmitted","views","category","service","videoDuration","hidden",0,"shadowHidden","hashedVideoID" FROM "sponsorTimes";
DROP TABLE "sponsorTimes";
ALTER TABLE sqlb_temp_table_12 RENAME TO "sponsorTimes";
UPDATE "config" SET value = 12 WHERE key = 'version';
COMMIT;