Skip to content

Instantly share code, notes, and snippets.

@gcphost
Created August 29, 2016 20:52
Show Gist options
  • Save gcphost/13bad6c0e7326fae82b066b194653f45 to your computer and use it in GitHub Desktop.
Save gcphost/13bad6c0e7326fae82b066b194653f45 to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterUsersTableAddUsernameIndex extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->index('username');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment