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

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

Closed
rentalhost opened this issue Aug 30, 2019 · 4 comments
Closed

Comments

@rentalhost
Copy link
Contributor

  • 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();
});
@rentalhost
Copy link
Contributor Author

@staudenmeir Could you help on this again? 😄

@staudenmeir
Copy link
Contributor

I'll look into it.

@staudenmeir
Copy link
Contributor

I've submitted a PR: doctrine/dbal#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();
                                                            ^      ^
});

@staudenmeir
Copy link
Contributor

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

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

No branches or pull requests

2 participants