Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Adding schema for Postgres #378

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

tkonop
Copy link

@tkonop tkonop commented May 5, 2019

Postgres sequence can use other schema than public. In this case NEXTVAL and CURRVAL should include Schema name like NEXTVAL("schema"."sequence_name"). In standard approach result of SequenceFeature class was NEXTVAL("schema.sequence_name") which is inproper behavior. I added checking, if the $sequenceName is instance of TableIdentifier. In this case NEXTVAL and CURRVALL is modified.

Provide a narrative description of what you are trying to accomplish:

  • Are you fixing a bug?

    • Detail how the bug is invoked currently.
    • Detail the original, incorrect behavior.
    • Detail the new, expected behavior.
    • Base your feature on the master branch, and submit against that branch.
    • Add a regression test that demonstrates the bug, and proves the fix.
    • Add a CHANGELOG.md entry for the fix.
  • Are you creating a new feature?

    • Why is the new feature needed? What purpose does it serve?
    • How will users use the new feature?
    • Base your feature on the develop branch, and submit against that branch.
    • Add only one feature per pull request; split multiple features over multiple pull requests
    • Add tests for the new feature.
    • Add documentation for the new feature.
    • Add a CHANGELOG.md entry for the new feature.
  • Is this related to quality assurance?

  • Is this related to documentation?

tkonop added 2 commits May 5, 2019 20:43
Postgres sequence can use other schema than public. In this case NEXTVAL and CURRVAL should include Schema name like NEXTVAL("schema"."sequence_name"). In standard approach result of SequenceFeature class was NEXTVAL("schema.sequence_name") which is inproper behavior. I added checking, if the $sequenceName is instance of TableIdentifier. In this case NEXTVAL and CURRVALL is modified.
@michalbundyra
Copy link
Member

@tkonop Thanks for your contribution. We need unit test to demonstrate the bug and cover the changes.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-db; a new issue has been opened at laminas/laminas-db#8.

@weierophinney
Copy link
Member

This repository has been moved to laminas/laminas-db. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:

  • Squash all commits in your branch (git rebase -i origin/{branch})
  • Make a note of all changed files (`git diff --name-only origin/{branch}...HEAD
  • Run the laminas/laminas-migration tool on the code.
  • Clone laminas/laminas-db to another directory.
  • Copy the files from the second bullet point to the clone of laminas/laminas-db.
  • In your clone of laminas/laminas-db, commit the files, push to your fork, and open the new PR.
    We will be providing tooling via laminas/laminas-migration soon to help automate the process.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants