title: Laravel 5.6: Table creation failed
body: <p>I'm new to Laravel and I'm trying to create tables using <code>Schema</code> façade. I create the migration file with command</p>
  
  <pre><code>php artisan make:migration create_products_define_standards_table --create=products_define_standards
  </code></pre>
  
  <p>Here's the file:</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateStandardsTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('products_define_standards', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('code')-&gt;unique();
              $table-&gt;string('image');
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('products_define_standards');
      }
  }
  </code></pre>
  
  <p>It really has almost the same content of the default <code>CreateUsersTable</code>, but when I run <code>php artisan migrate</code> it creates:</p>
  
  <ul>
  <li><code>users</code>' table (default)</li>
  <li><code>migrations</code>' table (default)</li>
  </ul>
  
  <p>but <em>not</em>:</p>
  
  <ul>
  <li><code>password_resets</code>' table (default)</li>
  <li><code>products_define_standards</code>' table (custom)</li>
  </ul>
  
  <p>I tried with <code>php artisan migrate:fresh</code> but I get the same log:</p>
  
  <pre><code>Dropped all tables successfully.
  Migration table created successfully.
  
     Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))
  
    at /home/whatever/whatever.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php: 664
    660:         // If an exception occurs when attempting to run a query, we'll format the error
    661:         // message to include the bindings with SQL, which will make this exception a
    662:         // lot more helpful to the developer instead of just the database's errors.
    663:         catch (Exception $e) {
    664:             throw new QueryException(
    665:                 $query, $this-&gt;prepareBindings($bindings), $e
    666:             );
    667:         }
    668: 
    669:         return $result;
  
    Exception trace:
  
    1   PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes")
        /home/whatever/whatever.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php : 458
  
    2   PDOStatement::execute()
        /home/whatever/whatever.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php : 458
  </code></pre>
  
  <p>I found <a href="https://stackoverflow.com/a/41271795/6465600">this answer</a> and I run also <code>composer dumpauto</code> but the result is the same.</p>
  
  <p>Am I missing something? Should I do any other thing to register the migration somewhere else?</p>