When you look at: https://github.com/schambers/fluentmigrator/blob/master/src/FluentMigrator.Runner/Generators/Postgres/PostgresTypeMap.cs, if you go to ~ line 24, where it defines the "Decimal" types, for the one where you want to specify the storage options, it has the size/precision backwards in comparison to the variables being passed into it from the .AsDecimal() method.
E.g., to specify a field with a total length of 18, and a precision of 4, I had to do .AsDecimal(4,18) instead of .AsDecimal(18,4).
This is as of the latest nuget build on 9/15/2012 @ 4:00 AM EDT.
I changed the defaults based on Postgres Documentation (http://www.postgresql.org/docs/8.1/static/datatype.html)
Unfortunately, I forgot to reverse the generic decimal map as well. :(
"The types decimal and numeric are equivalent. Both types are part of the SQL standard."
"The scale of a numeric is the count of decimal digits in the fractional part, to the right of the decimal point. The precision of a numeric is the total count of significant digits in the whole number, that is, the number of digits to both sides of the decimal point."
And if you look up Arbitrary Numeric type, it's definition is:
I think the wording confused the contributor who implemented it. The precision in FluentMigrator's language is "size", and the scale is the "precision".
I guess simply reveresing it in the type map should be enough:
"SetTypeMap(DbType.Decimal, "decimal($precision,$size)", DecimalCapacity);"
"SetTypeMap(DbType.Decimal, "decimal($size,$precision)", DecimalCapacity);"
And of course check the tests, why they haven't failed.
Fix issue #303 with Postgres Typemap
Size and precision were in the wrong order for decimal in the type map. Test was also
Thanks for catching this. Fixed it in this commit: be2ed47