You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need set the initial auto increment value of message's id, and the sqlite's doc described the sqlite_sequence table. But when i try to manipulate it, i got an error, the table doesnt exists.
So i read the migrator's code, the DataTypeOf() method checks if the field is auto increment and not primary key field, migrator will generate proper statement to support auto increment.
But the ID field defaults handled as primary key, the problem seems can't fixed.
Gorm docs Conventions section say, we can use tag primaryKey to set other field as primary key, but migrator reports an error table device has more than one primary key.
How to fix it? Thanks for reply.
The text was updated successfully, but these errors were encountered:
Description
Sample code below
I need set the initial auto increment value of message's id, and the sqlite's doc described the sqlite_sequence table. But when i try to manipulate it, i got an error, the table doesnt exists.
So i read the migrator's code, the
DataTypeOf()
method checks if the field is auto increment and not primary key field, migrator will generate proper statement to support auto increment.But the ID field defaults handled as primary key, the problem seems can't fixed.
Gorm docs Conventions section say, we can use tag
primaryKey
to set other field as primary key, but migrator reports an errortable device has more than one primary key
.How to fix it? Thanks for reply.
The text was updated successfully, but these errors were encountered: