From a8d7b9382a89d7ae5374ba4fe28ba5f2edf95e84 Mon Sep 17 00:00:00 2001 From: quel Date: Fri, 18 Dec 2009 03:48:28 +0800 Subject: [PATCH] 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 --- mysql2psql | 3 +++ 1 file changed, 3 insertions(+) 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})" -- 2.1.4