Skip to content

Commit

Permalink
Stage tables for rewritten media scanner for video library.
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnerrp committed Jul 8, 2012
1 parent 27c9d46 commit ac4e2d9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mythtv/bindings/perl/MythTV.pm
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mythtv/bindings/python/MythTV/static.py
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythversion.h
Expand Up @@ -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();
Expand Down
35 changes: 35 additions & 0 deletions mythtv/libs/libmythtv/dbcheck.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit ac4e2d9

Please sign in to comment.