Permalink
Browse files

Stage tables for rewritten media scanner for video library.

  • Loading branch information...
wagnerrp committed Jul 8, 2012
1 parent 27c9d46 commit ac4e2d9e917939ced46b497da608127d0be03941
@@ -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
@@ -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'
@@ -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();
@@ -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;
}

0 comments on commit ac4e2d9

Please sign in to comment.