db-migrate / pg

A postgresql driver for db-migrate.
Other
67 stars 51 forks source link

fix(switchDatabase): scope configuration not working with schema #78

Closed jessicaschissato closed 1 year ago

jessicaschissato commented 1 year ago

I noticed the same issue reported in https://github.com/db-migrate/pg/issues/45, and it looks like a potential fix was abandoned, so this is a new proposal to fix the scoping issue:

jessicaschissato commented 1 year ago

@wzrdtales would you mind taking a look at this PR? I'm trying to use scoping, but there are some issues that need to be fixed (#45). This change fixes scoping to work with the schema property but creates a separate migrations table for each schema, is that the expectation? If not, there are some changes required in the createMigrationsTable to avoid resetting the search_path back to the main schema.

wzrdtales commented 1 year ago

hey sry, please feel free to bug multiple times, as things easily get under the radar...

removing the backticks is not a solution though. db-migrate strict standard is to use the appropriate quoting everywhere. So this PR can't be merged.

I am no user of postgres, so I would need to look up right now why exactly this is a problem now. B/c this driver is especially for postgres, and it worked for years, that would mean either this fix is not intended for postgres but some other db on the pg wire protocol, or postgres changed something.

Can you provide me with the insights to that?

wzrdtales commented 1 year ago

after just a quick look CREATE %s SEQUENCE it might be misconception that carried through. Wondering how this never was a problem, since this was in the code since I overtook the library long back. However I still need to have a closer look if this is not breaking anything, so any insight with links to docs is still welcome