Skip to content

Commit

Permalink
fix(tests): fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Firoozi Zamani committed Nov 30, 2024
1 parent 5698f88 commit 84bc529
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ func (m Migrator) CreateTable(values ...interface{}) (err error) {
field := stmt.Schema.FieldsByDBName[dbName]
if !field.IgnoreMigration {
if dbName == "id" {
s := fmt.Sprintf("{%s %!s(bool=false)}", m.CurrentTable(stmt).(clause.Table).Name)
// s := fmt.Sprintf("{%s %!s(bool=false)}", m.CurrentTable(stmt).(clause.Table).Name)
s := "{" + m.CurrentTable(stmt).(clause.Table).Name + " %!s(bool=false)}"
re := regexp.MustCompile(`\{([^ ]+)`)
match := re.FindStringSubmatch(s)
pk := fmt.Sprintf("? ? DEFAULT nextval('%s')", match[1])
Expand Down

0 comments on commit 84bc529

Please sign in to comment.