You are here: Reference Information > Command Line Tools > NuoDB Migrator > NuoDB Migrator Mappings for MySQL Unsigned Types

NuoDB Migrator Mappings for MySQL Unsigned Types

NuoDB datatypes are always signed (UNSIGNED modifiers are not allowed), therefore allowed ranges for MySQL UNSIGNED and NuoDB signed types will be different:

Column MySQL Type MySQL Range NuoDB Type NuoDB Range
f1 SMALLINT UNSIGNED [0,65535] SMALLINT [-32768,32767]
f2 MEDIUMINT UNSIGNED [0,16777215] INTEGER [-2147483648,2147483647]
f3 INT UNSIGNED [0,4294967295] INTEGER [-2147483648,2147483647]
f4 BIGINT UNSIGNED [0,18446744073709551615] BIGINT [-9223372036854775808,9223372036854775807]

The NuoDB Migrator converts each MySQL UNSIGNED type to the closest NuoDB numeric type, so that value loss and numeric overflow does not happen during data migration. Consider the following MySQL table (note the UNSIGNED modifier):

CREATE TABLE `t2` (`f1` SMALLINT UNSIGNED, `f2` MEDIUMINT UNSIGNED, `f3` INT UNSIGNED, `f4` BIGINT UNSIGNED);
INSERT INTO `t2` VALUES (65535, 16777215, 4294967295, 18446744073709551615);

This will be converted to:

CREATE TABLE "t2" ("f1" INTEGER, "f2" INTEGER, "f3" BIGINT, "f4" NUMERIC(21));
# table data will be migrated properly using bin/nuodb-migrator dump [...] & bin/nuodb-migrator load [...] commands