'postgres: 'relation "users" does not exist

All tests were passing before, but I updated a couple packages and now a bunch of tests are failing because the tests can't find any of the tables in my local/testing database (issue is not just with the users table but with all tables in my db). The package updates happened via Dependabot security fixes, and when the tests were run on the TravisCI server they all passed. Because everything was passing, I already merged the updates into the development branch. Nothing was failing until I pulled the branch and tried to run tests locally.

I can see the database and all the tables it can't find in pgAdmin. I have tried:

  • uninstalling/reinstalling Postgres
  • dropping/recreating the database and re-running migrations in knex to recreate all tables
  • re-installing pg and knex
  • ensuring that the schema is in the search_path as suggested here
  • ensuring that my psql user has schema-level privileges as suggested here

Any other ideas what I could try?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source