Skip to content

Commit

Permalink
Merge pull request #55 from Fulmineo64/master
Browse files Browse the repository at this point in the history
Updated Regexp to handle correctly string values
  • Loading branch information
jinzhu committed Mar 17, 2022
2 parents 16b5ee3 + 41e7fa5 commit 915f678
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion migrator.go
Expand Up @@ -144,7 +144,7 @@ func (m Migrator) RenameColumn(value interface{}, oldName, newName string) error
})
}

var defaultValueTrimRegexp = regexp.MustCompile("^\\('?(.*)'?\\)$")
var defaultValueTrimRegexp = regexp.MustCompile("^\\('?([^']*)'?\\)$")

// ColumnTypes return columnTypes []gorm.ColumnType and execErr error
func (m Migrator) ColumnTypes(value interface{}) ([]gorm.ColumnType, error) {
Expand Down

0 comments on commit 915f678

Please sign in to comment.