diff --git a/mythtv/bindings/perl/MythTV.pm b/mythtv/bindings/perl/MythTV.pm index 7b519c018b1..cb0d05532eb 100644 --- a/mythtv/bindings/perl/MythTV.pm +++ b/mythtv/bindings/perl/MythTV.pm @@ -115,7 +115,7 @@ package MythTV; # schema version supported in the main code. We need to check that the schema # version in the database is as expected by the bindings, which are expected # to be kept in sync with the main code. - our $SCHEMA_VERSION = "1306"; + our $SCHEMA_VERSION = "1307"; # NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is # the number of items in a ProgramInfo QStringList group used by diff --git a/mythtv/bindings/python/MythTV/static.py b/mythtv/bindings/python/MythTV/static.py index a9fabd75215..54b577751db 100644 --- a/mythtv/bindings/python/MythTV/static.py +++ b/mythtv/bindings/python/MythTV/static.py @@ -5,7 +5,7 @@ """ OWN_VERSION = (0,26,-1,1) -SCHEMA_VERSION = 1306 +SCHEMA_VERSION = 1307 NVSCHEMA_VERSION = 1007 MUSICSCHEMA_VERSION = 1018 PROTO_VERSION = '75' diff --git a/mythtv/libs/libmythbase/mythversion.h b/mythtv/libs/libmythbase/mythversion.h index 232ebacf6fb..6f4ff32711f 100644 --- a/mythtv/libs/libmythbase/mythversion.h +++ b/mythtv/libs/libmythbase/mythversion.h @@ -57,7 +57,7 @@ * mythtv/bindings/php/MythBackend.php #endif -#define MYTH_DATABASE_VERSION "1306" +#define MYTH_DATABASE_VERSION "1307" MBASE_PUBLIC const char *GetMythSourceVersion(); diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp index 7dd72569a38..082f22317cf 100644 --- a/mythtv/libs/libmythtv/dbcheck.cpp +++ b/mythtv/libs/libmythtv/dbcheck.cpp @@ -2240,6 +2240,41 @@ NULL return false; } + if (dbver == "1306") + { + // staging temporary tables to use with rewritten file scanner + // due to be replaced by finalized RecordedFile changes + + const char *updates[] = { +"CREATE TABLE scannerfile (" +" `fileid` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT," +" `filesize` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0," +" `filehash` VARCHAR(64) NOT NULL DEFAULT ''," +" `added` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP," +" PRIMARY KEY (`fileid`)," +" UNIQUE KEY filehash (`filehash`)" +") ENGINE=MyISAM DEFAULT CHARSET=utf8;", +"CREATE TABLE scannerpath (" +" `fileid` BIGINT(20) UNSIGNED NOT NULL," +" `hostname` VARCHAR(64) NOT NULL DEFAULT 'localhost'," +" `storagegroup` VARCHAR(32) NOT NULL DEFAULT 'Default'," +" `filename` VARCHAR(255) NOT NULL DEFAULT ''," +" PRIMARY KEY (`fileid`)," +" UNIQUE KEY path (`storagegroup`, `hostname`, `filename`)" +") ENGINE=MyISAM DEFAULT CHARSET=utf8;", +"CREATE TABLE videopart (" +" `fileid` BIGINT(20) UNSIGNED NOT NULL," +" `videoid` INT(10) UNSIGNED NOT NULL," +" `order` SMALLINT UNSIGNED NOT NULL DEFAULT 1," +" PRIMARY KEY `part` (`videoid`, `order`)" +") ENGINE=MyISAM DEFAULT CHARSET=utf8;", +NULL +}; + + if (!performActualUpdate(&updates[0], "1307", dbver)) + return false; + } + return true; }