dbcheck.h File Reference

Go to the source code of this file.

Functions

MTV_PUBLIC bool InitializeMythSchema (void)
 command to get the the initial database layout from an empty database:
MTV_PUBLIC bool UpgradeTVDatabaseSchema (const bool upgradeAllowed=false, const bool upgradeIfNoUI=false)
 Called from outside dbcheck.cpp to update the schema.

Function Documentation

MTV_PUBLIC bool InitializeMythSchema ( void   ) 

command to get the the initial database layout from an empty database:

mysqldump --skip-comments --skip-opt --compact --skip-quote-names \ --create-options --ignore-table=mythconverg.schemalock mythconverg | \ sed '/^\(SET\|INS\).*;$/d;/^\/\*!40101.*$/d;s/^.*[^;]$/"&"/;s/^).*;$/"&",/'

command to get the initial data:

mysqldump --skip-comments --skip-opt --compact --skip-quote-names -t \ --ignore-table=mythconverg.logging mythconverg | sed -e 's/^.*$/"&",/' -e 's#\#\\g'

don't forget to delete host specific data

Definition at line 2044 of file mythtv/libs/libmythtv/dbcheck.cpp.

Referenced by doUpgradeTVDatabaseSchema(), and main().

MTV_PUBLIC bool UpgradeTVDatabaseSchema ( const bool  upgradeAllowed,
const bool  upgradeIfNoUI 
)

Called from outside dbcheck.cpp to update the schema.

If the "DBSchemaVer" property equals the currentDatabase version this returns true immediately. If not, we try to do a database backup, if interactive prompt the user for permission to do the upgrade, and if permitted or non-interactive with a successful backup do the actual update.

If the program running this function is killed while this is running then the schema may be corrupted.

Returns:
false on failure, error, or if the user selected "Exit."

Definition at line 443 of file mythtv/libs/libmythtv/dbcheck.cpp.

Referenced by main(), and run_backend().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Sun May 27 06:41:44 2012 for MythTV by  doxygen 1.6.3