Laravel 4: Migration - Schema :: table - Text column automatically creates a primary unique index

I am creating a migration to Laravel with the following function:

public function up()
{
    Schema::create('translate_item', function(Blueprint $table)
    {
        $table->increments('id');
        $table->integer('lesson_id');
        $table->text('lang_1');
        $table->text('lang_2');
        $table->timestamps();
    });
}

      

The above creates text boxes as the main unique index as shown below: enter image description here

Can anyone explain why this is happening and how to create textboxes without making it the main index?

+3


source to share


1 answer


They are not actually created as a primary key or unique index.

It might look like . The fields are grayed out because the way phpMyAdmin displays the columns, you cannot make the primary key or unique.



No need to worry. text()

does nothing that you don't expect.

+2


source







All Articles