title: String as Primary Key in Laravel migration
body: <p>I've had to change a table in my database so that the <code>primary key</code> isn't the standard <code>increments</code>.</p>
  
  <p>Here's the migration,</p>
  
  <pre><code>public function up()
  {
      Schema::create('settings', function (Blueprint $table) {
          $table-&gt;text('code', 30)-&gt;primary();
          $table-&gt;timestamps();
          $table-&gt;text('name');
          $table-&gt;text('comment');
      });
  }
  </code></pre>
  
  <p>However, MySQL keeps returning with,</p>
  
  <blockquote>
    <p>Syntax error or access violation: 1170 BLOB/TEXT column 'code' used in
    key specification without a key length (SQL: alter table <code>settings</code>
    add primary key <code>settings_code_primary</code>(<code>code</code>)</p>
  </blockquote>
  
  <p>I've tried leaving the normal <code>increments</code> <code>id</code> in there and modifying the table in a different migration but the same thing happens.</p>
  
  <p>Any ideas of what I'm doing wrong?</p>
  
  <p><code>Laveral Version 5.4.23</code></p>