cakephp / cakephp/phinx

POSTGRES: When table is renamed all it's sequences should be also renamed

Open
#505 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
PHP
Stars
4.5k
Forks
884
PR merge metrics
No merged PRs in 30d

Description

public function change()
{
        $this->table('old_name')
            ->rename('new_name')
            ->save();
}

As a result we have table with new name, but with sequence old_name_id_seq

Contributor guide

Open the 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.

Research direction

Start from the table rename API shown in the migration example and trace the PostgreSQL-specific rename behavior. Reproduce renaming old_name to new_name and inspect the resulting sequence name. Done means the table and its associated sequences use the new name.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.