This project has moved and is read-only. For the latest updates, please go here.

Support for unsigned integer types coming any time soon?

May 30, 2014 at 12:51 AM
Edited May 30, 2014 at 12:54 AM
Support for unsigned integer types coming any time soon?

Right now all of my UNSIGNED INT columns are showing up as INT.
May 30, 2014 at 3:49 PM
AFAIK unsigned INTs are MySQL only. There's no equivalent in SqlServer, Oracle, PostgreSql etc.

I'll see what I can do- if I can get the information out from the Information_Schema metadata, I can use it.
May 30, 2014 at 10:14 PM
Sounds great. Thanks.

PS: Looks like Sybase also supports unsigned types:

PPS: Also, watch out for tinyint. It's unsigned (8-bit, 0-255) on most—if not all—systems that support an 8-bit integer type.
Jun 2, 2014 at 8:59 PM
Is (edits 34576 & 34577 on May 30) supposed to address this?
Jun 3, 2014 at 11:10 AM
Yes, the patch (actually a one liner) keeps the unsigned marker - at least against the MySQL version I have.

I don't think the functionality for simple database translations will work- I need to test more. So this may not be the final version, but it may be what you need.
Jun 3, 2014 at 8:37 PM
Just retried after applying 34576 & 34577 patches.

UNSIGNED INT columns still showing up as INT.

I'll keep an eye on the source history.

Thanks for working on this.
Jun 3, 2014 at 9:10 PM
MySQL version?
Jun 4, 2014 at 5:39 AM
5.5.24 on Mavericks
Jul 27, 2014 at 7:55 AM
Just released v1.3.4.0
The UNSIGNED flag is available as part of the DatabaseColumn.DbDataType string (eg "smallint(5) unsigned"- so to extract it, just do an .IndexOf("unsigned")!=-1 )

I didn't like adding a new property .IsUnsigned as I don't want to add more datatype properties (we already have DbDataType string, DataType object, Length, Precision, Scale, DateTimePrecision ... ). Instead there's an extension DatabaseColumn.DataTypeDefinition() that gives the DDL string, which ties up all these different properties.