add float unsigned
authorquel <github@quelrod.net>
Thu, 17 Dec 2009 19:48:28 +0000 (03:48 +0800)
committerMax Lapshin <max@maxidoors.ru>
Thu, 17 Dec 2009 19:59:11 +0000 (03:59 +0800)
There is no loss of precision:
"Floating-point and fixed-point types also can be UNSIGNED. As with integer
types, this attribute prevents negative values from being stored in the column.
However, unlike the integer types, the upper range of column values remains the
same."
http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html

mysql2psql

index f70725a..6cc4f5c 100755 (executable)
@@ -238,6 +238,9 @@ class PostgresWriter < Writer
     when "float"
       default = " DEFAULT #{column[:default].nil? ? 'NULL' : column[:default].to_f}" if default
       "real"
+    when "float unsigned"
+      default = " DEFAULT #{column[:default].nil? ? 'NULL' : column[:default].to_f}" if default
+      "real"
     when "decimal"
       default = " DEFAULT #{column[:default].nil? ? 'NULL' : column[:default]}" if default
       "numeric(#{column[:length] || 10}, #{column[:decimals] || 0})"