Go to the source code of this file.
Functions | |
| MPUBLIC int | CompareTVDatabaseSchemaVersion (void) |
| Called from outside dbcheck.cpp to compare the database schema version with the expected version. | |
| MPUBLIC bool | UpgradeTVDatabaseSchema (void) |
| Called from outside dbcheck.cpp to update the schema. | |
| MPUBLIC int CompareTVDatabaseSchemaVersion | ( | void | ) |
Called from outside dbcheck.cpp to compare the database schema version with the expected version.
If the "DBSchemaVer" property is not found (i.e. the schema has not been initialized, the function returns negative, as if the schema simply needed upgrading, so InitializeDatabase() can do its job.
We lock the schemalock table for write so that we block if there are any DB schema updates in progress. This will make sure that we get the correct schema version number after the updates are completed and the update process unlocks the schemalock table.
Definition at line 494 of file mythtv/libs/libmythtv/dbcheck.cpp.
Referenced by CheckSchemaVersion(), and main().
| MPUBLIC bool UpgradeTVDatabaseSchema | ( | void | ) |
Called from outside dbcheck.cpp to update the schema.
If the "DBSchemaVer" property equals the currentDatabase version this returns true immediately. If not we lock the schemalock table. If this fails we return false. If it succeeds we call doUpgradeTVDatabaseSchema() to do the actual update, and then we unlock the schemalock table.
If the program running this function is killed while this is running then the schema may be corrupted.
Definition at line 526 of file mythtv/libs/libmythtv/dbcheck.cpp.
Referenced by CheckSchemaVersion(), and main().
1.5.5