title: Laravel - [PDOException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ip.priorities' doesn't exist
body: <p>Hello im trying to migrate a table named <code>ideas_roles_users</code> with Laravel 5.1 but im getting the error </p>
  
  <blockquote>
    <p>[PDOException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ip.priorities' doesn't exist. </p>
  </blockquote>
  
  <p>I'm really new with Laravel, hope anyone can help me. As you see im trying to make a table many to many and the error becomes from class <code>CreateIdeasRolesUsersTable</code>. Thank you.</p>
  
  <pre><code>&lt;?
  
  class CreateIdeasRolesUsersTable extends Migration
  
  {
      public function up()
      {
  Schema::create('ideas_roles_users', function (Blueprint $table) {
              $table-&gt;integer('id_ideas')-&gt;unsigned();
              $table-&gt;integer('id_roles')-&gt;unsigned();
              $table-&gt;integer('id_users')-&gt;unsigned();
  
              $table-&gt;primary(['id_ideas', 'id_roles', 'id_users']);
  
  
              $table-&gt;timestamps();
  
          });
  
          Schema::table('priorities', function($table) {
            $table-&gt;foreign('id_ideas')-&gt;references('id')-&gt;on('ideas');
            $table-&gt;foreign('id_roles')-&gt;references('id')-&gt;on('roles');
            $table-&gt;foreign('id_users')-&gt;references('id')-&gt;on('users');
         });
  
  
      }
      public function down()
      {
          Schema::drop('ideas_roles_users');
      }
  }
  </code></pre>
  
  <p>My class for Ideas  </p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateIdeasTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('ideas', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('nombre');
              $table-&gt;string('descripcion');
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::drop('ideas');
      }
  }
  </code></pre>
  
  <p>my class for users </p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateUsersTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('users', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('user');
              $table-&gt;string('nombre');
              $table-&gt;string('appellidoP');
              $table-&gt;string('appellidoM');
              $table-&gt;string('email')-&gt;unique();
              $table-&gt;string('password', 60);
              $table-&gt;string('pais');
              $table-&gt;string('estado');
              $table-&gt;string('ciudad');
              $table-&gt;rememberToken();
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::drop('users');
      }
  }
  </code></pre>
  
  <p>My class for Roles is:</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateRolesTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('roles', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('nombre');
              $table-&gt;longText('descripcion');
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::drop('roles');
      }
  }
  </code></pre>