dialect/sql/schema: support setting schema name for migration (#4327)

This commit is contained in:
Ariel Mashraki
2025-02-12 18:18:03 +02:00
committed by GitHub
parent da9f897368
commit c5db03c30e
11 changed files with 115 additions and 31 deletions

View File

@@ -30,6 +30,9 @@ type MySQL struct {
// init loads the MySQL version from the database for later use in the migration process.
func (d *MySQL) init(ctx context.Context) error {
if d.version != "" {
return nil // already initialized.
}
rows := &sql.Rows{}
if err := d.Query(ctx, "SHOW VARIABLES LIKE 'version'", []any{}, rows); err != nil {
return fmt.Errorf("mysql: querying mysql version %w", err)