PostgreSQL driver should not be hard-coded to public schema

Open
#15 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
php, postgresql
Domain
databases

Research direction

Start in src/Codeception/Lib/Driver/PostgreSql.php, comparing the schema handling in the load method with cleanup. Reproduce the failure using a testing schema other than public and verify that cleanup no longer requires ownership of the public schema.

Written by the indexing model from the issue text.

Description

What are you trying to achieve?

In src/Codeception/Lib/Driver/PostgreSql.php, the schema is hard-coded to "public" in method cleanup. In my setup, where the schema used for testing is not public, this causes tests to fail with a ModuleException:
[ModuleException] Db: SQLSTATE[42501]: Insufficient privilege: 7 ERROR: must be owner of schema public
The schema is taken into account in "load" method, and this should also be brought into cleaning up the test database.

Details
  • Codeception version: 2.3.7
  • PHP Version: 7.0.22
  • Operating System: Ubuntu
  • Installation type: Phar
  • List of installed packages (composer show)
Dominant language
PHP
Stars
23
Forks
31
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Codeception/module-db

All issues in Codeception/module-db

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.