Non-set keys should not be altered
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
Moved https://github.com/cakephp/migrations/issues/330 over to here.
Currently
$table->changeColumn('status', 'string', [
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
]);
Kills most other settings like
'null' => true,
'default' => null,
Silently changing the other table field properties here now makes inserts impossible without specifying these now non-null-default values.
One always needs to check and add all those into every changeColumn, instead of just altering what is defined here in the migration file.
This leads to some really dangerous DB regressions.
Maybe we can merge with existing scheme before applying?
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
Start at the changeColumn entry point shown in the issue and reproduce the migration that changes only the column type while existing null and default settings are present. Trace how the current column definition is built and applied, then verify that unspecified properties remain unchanged and that inserts still work without explicitly supplying them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100