Migrator allow to change from NOT NULL to DEFAULT NULL
This commit is contained in:
parent
8c3018b96a
commit
bcb72fdddd
@ -437,8 +437,8 @@ func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnTy
|
|||||||
|
|
||||||
// check nullable
|
// check nullable
|
||||||
if nullable, ok := columnType.Nullable(); ok && nullable == field.NotNull {
|
if nullable, ok := columnType.Nullable(); ok && nullable == field.NotNull {
|
||||||
// not primary key & database is nullable
|
// not primary key
|
||||||
if !field.PrimaryKey && nullable {
|
if !field.PrimaryKey {
|
||||||
alterColumn = true
|
alterColumn = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user