title: Laravel 6 - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;
body: <p>when I run</p>
  
  <pre><code>php artisan migrate
  </code></pre>
  
  <p>to migrate this <code>Schema</code></p>
  
  <pre class="lang-php prettyprint-override"><code>public function up()
  {
      Schema::create('transaction_ins', function (Blueprint $table) {
          $table-&gt;bigIncrements('id');
          $table-&gt;string('idTransactionIN');
          $table-&gt;date('buy_date');
          $table-&gt;string('id_Supplier')-&gt;unsigned();
          $table-&gt;string('id_DeviceType')-&gt;unsigned();
          $table-&gt;string('id_DeviceBrand')-&gt;unsigned();
          $table-&gt;string('device_name');
          $table-&gt;mediumText('device_name');
          $table-&gt;decimal('device_price', 11, 2);
          $table-&gt;integer('amount');
          $table-&gt;decimal('sum_price', 15, 2);
          $table-&gt;mediumText('context');
          $table-&gt;timestamps();
  
          //Foreign Key
          $table-&gt;foreign('id_Supplier')-&gt;references('idSupplier')-&gt;on('suppliers')-&gt;onUpdate('cascade');
          $table-&gt;foreign('id_DeviceType')-&gt;references('idDeviceType')-&gt;on('device_types')-&gt;onUpdate('cascade');
          $table-&gt;foreign('id_DeviceBrand')-&gt;references('idDevicebrand')-&gt;on('device_brands')-&gt;onUpdate('cascade');
      });
  }
  </code></pre>
  
  <p>I get this error message</p>
  
  <blockquote>
    <p>Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or
    access violation: 1064 You  have an error in your SQL syntax; check
    the manual that corresponds to your MariaDB server version for the
    right syntax to use near 'unsigned not null, <code>id_DeviceType</code>
    varchar(255) unsigned not null, <code>id_DeviceBra' at line 1 (SQL: create
    table</code>transaction_ins<code>(</code>id<code>bigint unsigned not null auto_increment
    primary key,</code>idTransactionIN<code>varchar(255) not null,</code>buy_date<code>date
    not null,</code>id_Supplier<code>varchar(255) unsigned not null,
    </code>id_DeviceType<code>varchar(255) unsigned not null,</code>id_DeviceBrand<code>
    varchar(255) unsigned not null,</code>device_name<code>varchar(255) not null,
    </code>device_name<code>mediumtext not null,</code>device_price<code>decimal(11, 2) not
    null,</code>amount<code>int not null,</code>sum_price<code>decimal(15, 2) not null,
    </code>context<code>mediumtext not null,</code>created_at<code>timestamp null,
    </code>updated_at` timestamp null) default character set utf8mb4 collate
    'utf8mb4_unicode_ci')</p>
  </blockquote>