title: Laravel MariaDB errno:150 "Foreign key constraint is incorrectly formed"
body: <p>my posts migration is :</p>
  
  <pre><code>        Schema::create('posts', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;string('channel_id');
          $table-&gt;foreign('channel_id')-&gt;references('id')-&gt;on('channels');
          $table-&gt;string('title');
          $table-&gt;text('content');
          $table-&gt;string('status')-&gt;default('published');
          $table-&gt;string('type');
          $table-&gt;string('published_at');
          $table-&gt;timestamps();
      });
  </code></pre>
  
  <p>and channels :</p>
  
  <pre><code>        Schema::create('channels', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;string('name');
          $table-&gt;string('description');
          $table-&gt;string('channel_id');
          $table-&gt;timestamps();
      });
  </code></pre>
  
  <p>now , when I executed <code>php artisan migrate</code> the following error message showed up :</p>
  
  <pre><code>  [Illuminate\Database\QueryException]
    SQLSTATE[HY000]: General error: 1005 Can't create table `TBL_NAME`.`#sql-
    2221_1f76c` (errno: 150 "Foreign key constraint is incorrectly formed") (SQ
    L: alter table `posts` add constraint `posts_channel_id_foreign` foreign ke
    y (`channel_id`) references `channels` (`id`))
  
  
    [PDOException]
    SQLSTATE[HY000]: General error: 1005 Can't create table `TBL_NAME`.`#sql-
    2221_1f76c` (errno: 150 "Foreign key constraint is incorrectly formed")
  </code></pre>
  
  <p>I'm using Laravel 5.3 and thats migrations works perfectly on my local computer that I use MySQL on it. but when I upload my Laravel project on the server and I using MariaDB on the server. I see that error message.</p>