Alter key support?
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
In some conditions keys are not modifiable while you could still modify them using plain sql.
Say you have foreign key. If you want to modify that key by adding another column to the key, you could do it like this way:
ALTER TABLE `records`
DROP INDEX `record_types`,
ADD UNIQUE `record_types` (`edition_id`, `date`);
However, phinx splits this into two queries and this surely breaks as this key is required and could not be removed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by reproducing a foreign-key key modification using the combined MySQL ALTER TABLE statement and the two statements Phinx generates, then trace the migration path that alters keys. Done means the key can be modified without failing because the required key is removed first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100