Search for the migrations table in the correct schema#41
Search for the migrations table in the correct schema#41marton78 wants to merge 1 commit intoThomWright:masterfrom
Conversation
|
See #33 |
|
I see, same problem, different solution. But that one requires tests and there doesn't seem to be progress since January, whereas this fix "just works". Doesn't it? |
|
No. This approach was suggested in the thread I linked to, but was thought to be a breaking change:
To which I responded:
^ This is what I will accept a PR for. With appropriate tests. To make sure this keeps working for people, tests for the following would be good:
|
|
Sorry, I wasn't aware that it's possible to have the migrations table anywhere else but in the |
|
I also didn't know that! This is why I linked to #33 - it's in there. See here for some documentation: https://www.postgresql.org/docs/9.6/ddl-schemas.html#DDL-SCHEMAS-PATH |
Currently, when checking if the
migrationstable has to be created,doesTableExist()will succeed if there a table namedmigrationscan be found in any schema. This means thatpostgres-migrationsfails to start if there is another table calledmigrations, even if it's in another schema!In our case, this lead to an incompatibility with graphile-worker, which has its own
migrationstable in its own schema.The fix ensures that only the
publicschema is considered when looking for the table.