Add canonicalize for "db.schema" property

DS-2201: Unable to complete installation of DSpace with non-empty variable "db.schema" configuration file "build.properties"
This commit is contained in:
ctu-developers
2014-10-28 21:09:36 +01:00
parent 94af415f72
commit c1220456fd

View File

@@ -868,22 +868,22 @@ public class DatabaseManager
} }
/** /**
* Return the canonical name for a table. * Return the canonical name for a database object.
* *
* @param table * @param db_object
* The name of the table. * The name of the database object.
* @return The canonical name of the table. * @return The canonical name of the database object.
*/ */
static String canonicalize(String table) static String canonicalize(String db_object)
{ {
// Oracle expects upper-case table names // Oracle expects upper-case table names, schemas, etc.
if (isOracle) if (isOracle)
{ {
return (table == null) ? null : table.toUpperCase(); return (db_object == null) ? null : db_object.toUpperCase();
} }
// default database postgres wants lower-case table names // default database postgres wants lower-case table names
return (table == null) ? null : table.toLowerCase(); return (db_object == null) ? null : db_object.toLowerCase();
} }
//////////////////////////////////////// ////////////////////////////////////////
@@ -1402,7 +1402,7 @@ public class DatabaseManager
try try
{ {
String schema = ConfigurationManager.getProperty("db.schema"); String schema = canonicalize(ConfigurationManager.getProperty("db.schema"));
if(StringUtils.isBlank(schema)){ if(StringUtils.isBlank(schema)){
schema = null; schema = null;
} }