Skip to content

migration_table_name is Appended to Postgres Connection String #587

@emmercm

Description

@emmercm

Description

The migration_table_name option is added to Postgres connection strings, resulting in SQLSTATE 42704:

$ soda create --debug --env dml --path migrations-dml
v5.2.4

[POP] 2020/09/02 14:27:58 debug - Loading config file from /database.yml
[POP] 2020/09/02 14:27:58 info - create pricing (postgres://testing:testing@localhost:5432/primary?migration_table_name=dml_migration)
[POP] 2020/09/02 14:27:58 sql - CREATE DATABASE "pricing"
Error: couldn't create database pricing: error creating PostgreSQL database pricing: failed to connect to `host=localhost user=testing database=postgres`: server error (FATAL: unrecognized configuration parameter "migration_table_name" (SQLSTATE 42704))

Database, user, password, and etc. are masked/generic on purpose.

Steps to Reproduce the Problem

Given a database config file such as config/database.yml:

database:
  dialect: "postgres"
  database: {{ envOr "DB_NAME" "primary" }}
  host: {{ envOr "DB_HOST" "localhost" }}
  port: {{ envOr "DB_PORT" "5432" }}
  user: {{ envOr "DB_USER" "testing" }}
  password: {{ envOr "DB_PASSWORD" "testing" }}
  # default migration_table_name is "schema_migration"

dml:
  dialect: "postgres"
  database: {{ envOr "DB_NAME" "primary" }}
  host: {{ envOr "DB_HOST" "localhost" }}
  port: {{ envOr "DB_PORT" "5432" }}
  user: {{ envOr "DB_USER" "testing" }}
  password: {{ envOr "DB_PASSWORD" "testing" }}
  options:
    migration_table_name: dml_migration

With those two migration folders existing on disk, run the command:

soda create --debug --env dml --path migrations-dml

And get the output above.

Expected Behavior

The option to work as described in documentation.

Actual Behavior

It did not work as described in documentation.

Info

Alpine 3.12, Go 1.14.6, soda built from source as v5.2.4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workings: triageSome tests need to be run to confirm the issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions