minhphien / migratordotnet

Automatically exported from code.google.com/p/migratordotnet
0 stars 0 forks source link

TransformationProviderase.AddBooleanColunWithDefault is failing against Oracle XE 10.2.0.1.0 #106

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the test against Oracle XE 10.2.0.1.0

Oracle has no native boolean type so you have to use Number(1) instead.

The AddBooleanWithDefault is trying to put the value "FALSE" as default 
value of a Number(1) column witch generates an exception.

To solve that, add these lines to the class OracleDialect.cs

public override string Default(object defaultValue) {
    if (defaultValue.GetType().Equals(typeof(bool))) {
        defaultValue = ((bool)defaultValue) ? 1 : 0;
    }
    return String.Format("DEFAULT {0}", defaultValue);
}

Original issue reported on code.google.com by andrecar...@gmail.com on 9 Apr 2009 at 6:57