Added support to bypass PostgreSQL's use of 'TRUE' where other DBs use '1'

- http://wiki.alfresco.com/wiki/Schema_Upgrade_Scripts#Script_Variables


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14866 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-06-23 14:57:27 +00:00
parent 3602a7c989
commit fda4df9dee

View File

@@ -1013,6 +1013,16 @@ public class SchemaBootstrap extends AbstractLifecycleBean
sql = sql.replaceAll("\\$\\{" + var + "\\}", val.toString());
}
// Handle the 0/1 values that PostgreSQL doesn't translate to TRUE
if (this.dialect != null && this.dialect instanceof PostgreSQLDialect)
{
sql = sql.replaceAll("\\$\\{TRUE\\}", "TRUE");
}
else
{
sql = sql.replaceAll("\\$\\{TRUE\\}", "1");
}
Object fetchedVal = executeStatement(connection, sql, fetchColumnName, optional, line, scriptFile);
if (fetchVarName != null && fetchColumnName != null)
{