refactor: ensure non-null values in migration table creation

- Change the migration table creation to not allow null values for the column

Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
appleboy 2024-03-17 10:39:23 +08:00
parent 7a535a7899
commit d19b4e6a94
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -199,7 +199,7 @@ func (m *Migrate) createMigrationTableIfNotExists() error {
idCol := schemas.NewColumn(m.options.IDColumnName, "", schemas.SQLType{
Name: "VARCHAR",
}, 255, 0, true)
}, 255, 0, false)
idCol.IsPrimaryKey = true
table := schemas.NewTable(m.options.TableName, reflect.TypeOf(new(schemas.Table)))