mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 386368 - Use getters and setters for database schema version. r=sspitzer
This commit is contained in:
parent
dd606dc17d
commit
9091040e12
@ -521,18 +521,8 @@ nsNavHistory::InitDB(PRBool *aDoImport)
|
||||
|
||||
// Get the places schema version, which we store in the user_version PRAGMA
|
||||
PRInt32 DBSchemaVersion;
|
||||
{
|
||||
nsCOMPtr<mozIStorageStatement> statement;
|
||||
rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING("PRAGMA user_version"),
|
||||
getter_AddRefs(statement));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool hasResult;
|
||||
rv = statement->ExecuteStep(&hasResult);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ENSURE_TRUE(hasResult, NS_ERROR_FAILURE);
|
||||
DBSchemaVersion = statement->AsInt32(0);
|
||||
}
|
||||
rv = mDBConn->GetSchemaVersion(&DBSchemaVersion);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (PLACES_SCHEMA_VERSION != DBSchemaVersion) {
|
||||
// Migration How-to:
|
||||
@ -711,9 +701,7 @@ nsNavHistory::InitDB(PRBool *aDoImport)
|
||||
nsresult
|
||||
nsNavHistory::UpdateSchemaVersion()
|
||||
{
|
||||
nsCAutoString schemaVersionPragma("PRAGMA user_version=");
|
||||
schemaVersionPragma.AppendInt(PLACES_SCHEMA_VERSION);
|
||||
return mDBConn->ExecuteSimpleSQL(schemaVersionPragma);
|
||||
return mDBConn->SetSchemaVersion(PLACES_SCHEMA_VERSION);
|
||||
}
|
||||
|
||||
// nsNavHistory::InitStatements
|
||||
|
Loading…
Reference in New Issue
Block a user