sougatamondal / migratordotnet

Automatically exported from code.google.com/p/migratordotnet
0 stars 0 forks source link

MySQL does not support non-numeric primary keys (such as GUID) #132

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
ColumnProperty.PrimaryKey is defined as 64 | Unsigned | NotNull , which
sets all primary keys as unsigned.

MySQL is the only dialect that implements unsigned (by inserting "UNSIGNED"
into the column's SQL) but this is not legal if the column is non-numeric,
such as DbType.Guid 

This patch changes Dialect class to store a list of DbTypes that are
unsigned compatible, updates MysqlDialect to register the appropriate
DbTypes, revises ColumnPropertiesMapper to utilise this new functionality,
and provides 3 test cases showing correct implementation.

Also available here:
http://github.com/nats/migratordotnet/commit/44dcfdeefe0d51f00545f84b5fb80a0fd54
7f280

Original issue reported on code.google.com by nathan.o...@gmail.com on 13 Nov 2009 at 9:58

Attachments: