yiisoft / yiisoft/db

Add / document a more convenient way to specify composite primary keys

Open
#673 2 comments 1 reaction 1 assignee View on GitHub

@terabytesoftw is already working on this.

Since Apr 7, 2023.

type:docs type:enhancement
Dominant language
PHP
Stars
216
Forks
51
Avg merge
3d 10h
Merged PRs (30d)
2

Description

The way that was advised by @darkdef

$qb->createTable(
    'test',
    [
        'name' => 'varchar(255) NOT NULL',
        'email' => 'varchar(255) NOT NULL',
        'PRIMARY KEY (name, email)',
    ],
);

PRIMARY KEY (name, email):

  • This is not a column.
  • It's pretty basic for 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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.