Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MySQL] Custom collation for just one column in table #662

Closed
wants to merge 9 commits into from
Closed

[MySQL] Custom collation for just one column in table #662

wants to merge 9 commits into from

Conversation

trogwarz
Copy link

For issue #661 – add support collation for MySQL adapter. Now allowed this usage:

// ... Somewhere in migration ...
$this->table('foo')
    ->setOptions([
        'encoding'  => 'utf8',
        'collation' => 'utf8_general_ci',
    ])
    ->addColumn('text_one', 'string')
    ->addColumn('text_two', 'string', ['collation' => 'utf8mb4_unicode_ci''])
    ->save()
;

@trogwarz
Copy link
Author

TODO: check if this is available for other adapters (i don't have enough experience with other databases).

$table->addColumn('string_collation_default', 'string', array())->save();
$table->addColumn('string_collation_custom', 'string', array('collation' => 'utf8mb4_unicode_ci'))->save();
$rows = $this->adapter->fetchAll('SHOW FULL COLUMNS FROM table1');
$this->assertEquals('utf8_general_ci', $rows[2]['Collation']);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just can't run these tests on my environment. Please, check them and fix is there are some issues with this test.

@shadowhand
Copy link
Contributor

Thank you for contributing! The branch you made this PR against is no longer accepting patches. This probably happened because we didn't merge your changes fast enough. 😭

Please create a new PR against the current default branch if you want to see these changes merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants