yiisoft / yiisoft/db-migration

Not a bug, but a proposal for an upgrade/feature on migrations

Open
#13 17 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type:enhancement
Dominant language
PHP
Stars
32
Forks
18
Avg merge
22h 18m
Merged PRs (30d)
2

Description

As I said in the title, this is not a bug, but a proposal (didn't know where to write this that would be seen.

Now, on my project I have a big database (not in terms of data but in terms of tables and columns in those tables), and I also have a lot of indexes.
I noticed today that I need to write in a migration class
$this->createIndex('name', 'table', ['columns'])
after creating a new table, what I'm thinking should be a good idea is to add a possibility for method chaining on "createTable" function where I wouldn't need to enter table name for every index.
Or perhaps another parameter in createTable function that would easily let me add indexes in one place.

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 reading the migration API around createTable and createIndex, including how a migration class currently creates tables and indexes. Clarify whether chaining or an additional createTable parameter is intended, then define completion as allowing indexes to be declared with the new table without repeating its name.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.