yiisoft / yiisoft/db-migration

[Enh] add tableOptions in Migration

Open
#20 7 comments 0 reactions 1 assignee View on GitHub

@samdark is already working on this.

Since Aug 8, 2017.

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

Description

Yii use the following code in multiple places :

public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }
        $this->createTable('{{%whatever}}', [
            
        ], $tableOptions);
    }

https://github.com/yiisoft/yii2/blob/master/framework/rbac/migrations/m140506_102106_rbac_init.php#L56

https://github.com/yiisoft/yii2/blob/master/framework/web/migrations/m160313_153426_session_init.php#L26

https://github.com/yiisoft/yii2/blob/master/framework/caching/migrations/m150909_153426_cache_init.php#L44

some extensions as well

https://github.com/dektrium/yii2-user/blob/master/migrations/Migration.php#L39

you like we include this option to global custom tableOptions in configuration file?

what do you think about it?

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.