Skip to content

Ability to define index key length while creating schema #9256

@eidng8

Description

@eidng8

I've just tried out v5.1, and got the infamous ERR1071 while doing a artisan migrate, right after laravel new. I can't find out a good solution to it, yet. Because table charset is utf8mb4, and the email column is varchar(255), creating a unique on it will definitely cause error. I can't find out a way to specify the key length while calling

$table->string('email')->unique();

from the 2014_10_12_000000_create_users_table.php file.

After a little digging, it seems that we'll have to modify several index related functions in the Illuminate\Database\Schema\Blueprint class, and eventually (maybe not), the Illuminate\Support\Fluent.

Any hint?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions