Search
j0ke.net Open Build Service
>
Projects
>
multimedia
>
mythtv
> mythtv-dbcheck.diff
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File mythtv-dbcheck.diff of Package mythtv
--- ./libs/libmythtv/dbcheck.cpp.dbcheck 2008-04-28 22:33:59.000000000 +0200 +++ ./libs/libmythtv/dbcheck.cpp 2008-04-28 23:30:49.000000000 +0200 @@ -605,20 +605,8 @@ * versions. * */ -static bool doUpgradeTVDatabaseSchema(void) +static bool doUpgradeTVDatabaseSchema1027to1099(QString &dbver) { - QString dbver = gContext->GetSetting("DBSchemaVer"); - - if (dbver == currentDatabaseVersion) - return true; - - if (dbver == "") - { - if (!InitializeDatabase()) - return false; - dbver = "1112"; - } - if (dbver == "1027") { const QString updates[] = { @@ -1835,7 +1823,11 @@ if (!performActualUpdate(updates, "1100", dbver)) return false; } + return true; +} +static bool doUpgradeTVDatabaseSchema1100to1149(QString &dbver) +{ if (dbver == "1100") { const QString updates[] = { @@ -2497,7 +2489,11 @@ if (!performActualUpdate(updates, "1150", dbver)) return false; } + return true; +} +static bool doUpgradeTVDatabaseSchema1150to1199(QString &dbver) +{ if (dbver == "1150") { const QString updates[] = { @@ -3375,7 +3371,11 @@ if (!performActualUpdate(updates, "1200", dbver)) return false; } + return true; +} +static bool doUpgradeTVDatabaseSchema1200to1213(QString &dbver) +{ if (dbver == "1200") { MSqlQuery query(MSqlQuery::InitCon()); @@ -3631,10 +3631,30 @@ //"ALTER TABLE capturecard DROP firewire_node;" in 0.22 //"ALTER TABLE recordedmarkup DROP COLUMN offset;" in 0.22 //"ALTER TABLE channel DROP COLUMN commfree;" in 0.22 - return true; } +static bool doUpgradeTVDatabaseSchema(void) +{ + QString dbver = gContext->GetSetting("DBSchemaVer"); + + if (dbver == currentDatabaseVersion) + return true; + + if (dbver == "") + { + if (!InitializeDatabase()) + return false; + dbver = "1112"; + } + + if (!doUpgradeTVDatabaseSchema1027to1099(dbver)) return false; + if (!doUpgradeTVDatabaseSchema1100to1149(dbver)) return false; + if (!doUpgradeTVDatabaseSchema1150to1199(dbver)) return false; + if (!doUpgradeTVDatabaseSchema1200to1213(dbver)) return false; + + return true; +} bool InitializeDatabase(void)