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

[5.8] Fix MySQL Schema Grammar $modifiers order #29265

Merged
merged 2 commits into from Jul 23, 2019

Conversation

@mpyw
Copy link
Contributor

commented Jul 23, 2019

Charset/Collate must be placed before VirtualAs/StoredAs.

e.g.

$table->string('hash', 64)->charset('ascii')->storedAs('sha2(url, 256)')

According to Sequel Pro, this is equivalent to:

`hash` varchar(64) CHARACTER SET ascii GENERATED ALWAYS AS (sha2(`url`,256)) STORED

Currently, however, this is compiled as (Syntax Error):

`hash` varchar(64) as (sha2(url, 256)) stored character set ascii

@mpyw mpyw changed the title Fix MySQL Schema Grammar $modifiers order [5.8] Fix MySQL Schema Grammar $modifiers order Jul 23, 2019

mpyw added some commits Jul 23, 2019

Fix MySQL Schema Grammar $modifiers order
Charset/Collate must be placed before VirtualAs/StoredAs.

e.g.

```php
$table->string('hash', 64)->charset('ascii')->storedAs('sha2(`url`,256)')
```

According to Sequel Pro, this is equivalent to:

```sql
`hash` varchar(64) CHARACTER SET ascii GENERATED ALWAYS AS (sha2(`url`,256)) STORED
```

@taylorotwell taylorotwell merged commit b41c04a into laravel:5.8 Jul 23, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mpyw mpyw deleted the mpyw:fix-mysql-schema-grammar-modifiers-order branch Jul 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.