Skip to content

Commit db8fbf0

Browse files
Update migrator.go
Co-authored-by: Copilot <[email protected]> Signed-off-by: Nick Campbell <[email protected]>
1 parent ee4c31d commit db8fbf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

migrator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (m Migrator) FullDataTypeOf(field *schema.Field) clause.Expr {
3939
if field.PrimaryKey {
4040
// DuckDB doesn't support native AUTO_INCREMENT, so we use sequences to emulate this behavior for auto-increment primary keys
4141
// Check if this is an auto-increment field (no default value specified)
42-
if field.AutoIncrement || (!field.HasDefaultValue && field.DataType == schema.Uint) {
42+
if m.isAutoIncrementField(field) {
4343
// Use BIGINT with a default sequence value
4444
expr.SQL = "BIGINT DEFAULT nextval('seq_" + strings.ToLower(field.Schema.Table) + "_" + strings.ToLower(field.DBName) + "')"
4545
} else {

0 commit comments

Comments
 (0)