From: quel Date: Thu, 17 Dec 2009 19:48:28 +0000 (+0800) Subject: add float unsigned X-Git-Url: http://git.neszt.hu/?a=commitdiff_plain;h=a8d7b9382a89d7ae5374ba4fe28ba5f2edf95e84;p=mysql2postgres add float unsigned 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 --- diff --git a/mysql2psql b/mysql2psql index f70725a..6cc4f5c 100755 --- a/mysql2psql +++ b/mysql2psql @@ -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})"