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 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)