db-migrate / node-db-migrate

Database migration framework for node
Other
2.32k stars 360 forks source link

How Should the Schemas Work #741

Open kudla opened 3 years ago

kudla commented 3 years ago

I'm submitting a...

Please how should one deal with the schemas?

Current behavior

Currently I define schema similar to how it is described in docs

Both migration table and migration content are created in the public schema.

Behavior is the same regardless of the defined schema existence.

Expected behavior

Minimal reproduction of the problem with instructions

{
    "defaultEnv": "def",
    "def": {
      "driver": "pg",
      "host": {"ENV": "PGHOST"},
      "port": {"ENV": "PGPORT"},
      "database": {"ENV": "PGDATABASE"},
      "schema": {"ENV": "PGSCHEMA"},
      "user": {"ENV": "PGUSER"},
      "table": {"ENV": "PG_MIGRATION_TABLE"},
      "password": {"ENV": "PGPASSWORD"}
    }
}

I've tried both ENV link and exact value

What is the motivation / use case for changing the behavior?

Using data separation on schemas level

Environment


db-migrate version: 1.0.0-beta.15, 0.11.12
plugins with versions: not sure I have one
db-migrate driver with versions: pg 1.2.2

Additional information:
- Node version: 14.17.0
- Platform:  Mac

Others:

kylecombes commented 2 years ago

I'm also wondering how one configures what schema the migration tables are stored under. (I've got an automatic API generator and I'd like to keep the migrations tables out of where it's looking.)

kylecombes commented 2 years ago

It looks like this issue was reported back in 2017 (#459).

nstylo commented 8 months ago

Same issue for me. Will this ever be tackled?