Commit 657a0189 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Added System.out and confirmation of db upgraded.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1582 b35dd754-fafc-0310-a699-88a17e54d16e
parent bc7fca65
......@@ -340,6 +340,8 @@ public class DbConnectionManager {
}
catch (Exception e) {
Log.error("Database upgrade failed. Please manually upgrade your database.", e);
System.out.println("Database upgrade failed. Please manually upgrade your " +
"database.");
}
}
catch (Exception e) {
......@@ -688,19 +690,25 @@ public class DbConnectionManager {
try { if (pstmt != null) { pstmt.close(); } }
catch (Exception e) { Log.error(e); }
}
if (minorVersion == CURRENT_MINOR_VERSION) {
if (majorVersion == CURRENT_MAJOR_VERSION && minorVersion == CURRENT_MINOR_VERSION) {
return false;
}
// The database is an old version that needs to be upgraded.
Log.info("Found old database schema (" + majorVersion + "." + minorVersion + "). " +
"Upgrading to latest schema.");
System.out.println("Found old database schema (" + majorVersion + "." +
minorVersion + "). " + "Upgrading to latest schema.");
if (databaseType == DatabaseType.unknown) {
Log.info("Warning: database type unknown. You must manually upgrade your database.");
System.out.println("Warning: database type unknown. You must manually upgrade your " +
"database.");
return false;
}
else if (databaseType == DatabaseType.interbase) {
Log.info("Warning: automatic upgrades of Interbase are not supported. You " +
"must manually upgrade your database.");
System.out.println("Warning: automatic upgrades of Interbase are not supported. You " +
"must manually upgrade your database.");
return false;
}
// Run all upgrade scripts until we're up to the latest schema.
......@@ -748,6 +756,8 @@ public class DbConnectionManager {
}
}
}
Log.info("Database upgraded successfully.");
System.out.println("Database upgraded successfully.");
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment