<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCityTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cities', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
            $table->integer('X');
            $table->integer('Y');
            $table->string('name')->nullable();
            $table->index('X');
            $table->index('Y');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('cities');
    }
}

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCityTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cities', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
            $table->integer('X');
            $table->integer('Y');
            $table->string('name')->unique();
            $table->index('X');
            $table->index('Y');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('cities');
    }
}

Change the name to be a unique index.
Change the name to be a unique index.

 - this is bad practice, I should have migrated it properly.
 - Also, the reason I'm doing this is to make sure we don't duplicate X&Y.
 - This is just a bad way of doing this all around, but it's cheap.
 - right now cheap is good (given the time constraint)
