cakephp / cakephp/phinx

changeColumn make columns `not null`

Open
#596 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Consider if want to change length of a nullable column. using ['length' => MysqlAdapter::INT_TINY] make the column not null. I have to specify 'null'=>true] options to prevent that. I think Phinx should not change unspecified options.

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 by tracing the changeColumn path and the MysqlAdapter handling of a length-only change on a nullable column. Reproduce the reported case with ['length' => MysqlAdapter::INT_TINY] and compare it with the explicit 'null' => true option. Done means unspecified options, especially nullability, remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.