title: Laravel "Specified key was too long" when creating notifications table
body: <p>I am using Laravels' default migration to create a notifications table.</p>
  
  <pre><code>public function up()
  {
      Schema::create('notifications', function (Blueprint $table) {
          $table-&gt;uuid('id')-&gt;primary();
          $table-&gt;string('type');
          $table-&gt;morphs('notifiable');
          $table-&gt;text('data');
          $table-&gt;timestamp('read_at')-&gt;nullable();
          $table-&gt;timestamps();
      });
  }
  </code></pre>
  
  <p>But I get an error when trying to use it: </p>
  
  <pre><code>[Illuminate\Database\QueryException]
    SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `notifications` add index `n
    otifications_notifiable_id_notifiable_type_index`(`notifiable_id`, `notifiable_type`))
  
  
  
    [Doctrine\DBAL\Driver\PDOException]
    SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
  
  
  
    [PDOException]
    SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>I changed the name of the index column to notifiable_index, but it still complaints about the length of the index key. </p>
  
  <pre><code>  [Illuminate\Database\QueryException]
    SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `notifications` add index `n
    otifiable_index`(`notifiable_id`, `notifiable_type`))
  
  
  
    [Doctrine\DBAL\Driver\PDOException]
    SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
  
  
  
    [PDOException]
    SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
  </code></pre>