mirror of
https://github.com/ent/ent.git
synced 2026-05-06 01:20:56 +03:00
dialect/sql/schema: support setting schema name for migration (#4327)
This commit is contained in:
@@ -30,6 +30,9 @@ type Postgres struct {
|
||||
// init loads the Postgres version from the database for later use in the migration process.
|
||||
// It returns an error if the server version is lower than v10.
|
||||
func (d *Postgres) init(ctx context.Context) error {
|
||||
if d.version != "" {
|
||||
return nil // already initialized.
|
||||
}
|
||||
rows := &sql.Rows{}
|
||||
if err := d.Query(ctx, "SHOW server_version_num", []any{}, rows); err != nil {
|
||||
return fmt.Errorf("querying server version %w", err)
|
||||
|
||||
Reference in New Issue
Block a user