mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
dialect/sql/schema: support setting schema name for migration (#4327)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user