Skip to content

Commit

Permalink
Added MariaDB info and another solution
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandobandeira authored Jan 26, 2017
1 parent 948bc6d commit 9d348f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ Command | Description
`$table->unique(['first', 'last']);` | Add a composite unique index.
`$table->index('state');` | Add a basic index.

#### Index Lengths & MySQL
#### Index Lengths & MySQL/MariaDB

Laravel uses the `utf8mb4` character set by default, which includes support for storing "emojis" in the database. If you are running a version of MySQL older than the 5.7.7 release, you may need to manually configure the default string length generated by migrations in order for MySQL to create indexes for them. You may configure this by calling the `Schema::defaultStringLength` method within your `AppServiceProvider`:
Laravel uses the `utf8mb4` character set by default, which includes support for storing "emojis" in the database. If you are running a version of MySQL older than the 5.7.7 release or a version of MariaDB older than the 10.2.2 release, you may need to manually configure the default string length generated by migrations in order for MySQL to create indexes for them. You may configure this by calling the `Schema::defaultStringLength` method within your `AppServiceProvider`:

use Illuminate\Support\Facades\Schema;

Expand All @@ -375,6 +375,8 @@ Laravel uses the `utf8mb4` character set by default, which includes support for
Schema::defaultStringLength(191);
}

Another solution for this problem is using the `innodb_large_prefix` option, check your RDBMS manual for instructions on how to properly enable it.

<a name="dropping-indexes"></a>
### Dropping Indexes

Expand Down

0 comments on commit 9d348f3

Please sign in to comment.