cakephp / cakephp/phinx

No support for limit on primary key

Open
#1,131 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I am trying to create a table with a blob primary key, in MySQL, but it fails because a key limit is mandatory when using text/blob column types as keys. I can't see any work-arounds when looking at MysqlAdapter::createTable(). An option named primary_key_limit would be perfect. Nor can I see a simple way to add a primary key to an existing table in a migration without using the primary_key table option.

Is there another way to achieve this without writing raw SQL?

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 in MysqlAdapter::createTable() and trace how the primary_key table option is translated for MySQL text/blob columns. Compare that path with the migration API for adding a primary key to an existing table; done means both cases can express the required key limit without raw SQL, with the relevant adapter or migration tests updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.