Skip to content

Commit

Permalink
feat: include target schema name in migration name
Browse files Browse the repository at this point in the history
  • Loading branch information
bevzzz committed Nov 12, 2024
1 parent 1799a0f commit ac8d221
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions migrate/auto.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ func (am *AutoMigrator) createSQLMigrations(ctx context.Context, transactional b
return nil, nil, fmt.Errorf("create sql migrations: %w", err)
}

name, _ := genMigrationName("auto")
name, _ := genMigrationName(am.schemaName + "_auto")
migrations := NewMigrations(am.migrationsOpts...)
migrations.Add(Migration{
Name: name,
Up: changes.Up(am.dbMigrator),
Down: changes.Down(am.dbMigrator),
Comment: "Changes detected by bun.migrate.AutoMigrator",
Comment: "Changes detected by bun.AutoMigrator",
})

// Append .tx.up.sql or .up.sql to migration name, dependin if it should be transactional.
Expand Down

0 comments on commit ac8d221

Please sign in to comment.