Skip to content

Commit

Permalink
Order of Modifiers Amended
Browse files Browse the repository at this point in the history
When unsigned() was added to a migration with an integer() or bigInteger(), the
order of modifiers would result in a query like:

```sql
`field` int primary key unsigned not null
```

This is invalid SQL and therefore caused errors on the migrations.

Issue reported, with steps to replicate, here:

#37781
  • Loading branch information
onelazydev committed Jun 22, 2021
1 parent 0144433 commit ca23daf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MySqlGrammar extends Grammar
* @var string[]
*/
protected $modifiers = [
'Primary', 'Unsigned', 'Charset', 'Collate', 'VirtualAs', 'StoredAs', 'Nullable',
'Unsigned', 'Primary', 'Charset', 'Collate', 'VirtualAs', 'StoredAs', 'Nullable',
'Srid', 'Default', 'Increment', 'Comment', 'After', 'First',
];

Expand Down

0 comments on commit ca23daf

Please sign in to comment.