fix (codegen): don't duplicate the primary-key getter for 'without rowid' tables
This commit is contained in:
@@ -87,6 +87,10 @@ var generate_model = &cobra.Command{
|
||||
// Skip expression indexes; there's no way to resolve an expression to a real column
|
||||
continue
|
||||
}
|
||||
if index.Origin == "pk" && table.IsWithoutRowid {
|
||||
// Already generated above, as the primary-key getter
|
||||
continue
|
||||
}
|
||||
cols := make([]schema.Column, len(index.Columns))
|
||||
for i, colName := range index.Columns {
|
||||
cols[i] = table.GetColumnByName(colName)
|
||||
|
||||
Reference in New Issue
Block a user