We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If a struct has an unsigned ID, then CreateAllTables generates incorrect SQL. E.g.
type Person struct { Id uint32 Name string Created int64 Updated int64 }
The trace statement says
gorptest: 20:28:16.303405 create table if not exists `person` (`Id` varchar(255) not null primary key auto_increment, `Name` varchar(255), `Created` bigint, `Updated` bigint) engine=InnoDB charset=UTF8; [[]]
So a varchar(255) has been incorrectly substituted instead of the 'int(10) unsigned' that would be expected.
The same problem applies with uint and uint64 too.
It also seems to happen with all uint, uint32 or uint64 fields, regardless of whether they are primary keys.
The text was updated successfully, but these errors were encountered:
The problem seems to be caused by MySQLDialect.ToSqlType not including a more complete set of reflect.Kind cases.
Sorry, something went wrong.
#44 - support uint primary key types
22e93ed
This is fixed now and tested across the 3 supported databases.
#44 - add assertions on post-insert bound Id field
d4c4bce
No branches or pull requests
If a struct has an unsigned ID, then CreateAllTables generates incorrect SQL. E.g.
The trace statement says
So a varchar(255) has been incorrectly substituted instead of the 'int(10) unsigned' that would be expected.
The same problem applies with uint and uint64 too.
It also seems to happen with all uint, uint32 or uint64 fields, regardless of whether they are primary keys.
The text was updated successfully, but these errors were encountered: