Framework: Schema Builder: collaction() should be wrapped by quotes (when change())

Created on 30 Aug 2019  路  4Comments  路  Source: laravel/framework

  • Laravel Version: 5.8.34 (lastest)
  • PHP Version: PHP 7.2.21
  • Database Driver & Version: MariaDB 10.3.17

Description:

Same as #23944. The difference is that it affects when you need run ->change().

Steps to reproduce

Schema::create('addresses', function (Blueprint $blueprint) {
    // That will works, once that was fixed by #23989.
    $blueprint->string('addressable_type')->collation('binary');
});

Schema::table('addresses', function (Blueprint $blueprint) {
    // That is the current problem.
    $blueprint->string('addressable_type', 400)->collation('binary')->change();
});

Most helpful comment

I'll look into it.

All 4 comments

@staudenmeir Could you help on this again? 馃槃

I'll look into it.

I've submitted a PR: https://github.com/doctrine/dbal/pull/3668

In the meantime, you'll need to quote the collation yourself:

Schema::table('addresses', function (Blueprint $blueprint) {
    $blueprint->string('addressable_type', 400)->collation('`binary`')->change();
                                                            ^      ^
});

It will be fixed in the next release of doctrine/dbal.

Was this page helpful?
0 / 5 - 0 ratings