title: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "categories" does not exist LINE 1: select * from "categories" ^ (SQL: select * from "categories")
body: <p>I just deployed on Heroku yesterday and connected to a Postgresql db and since then I have this fun error showing up on my screen (and terminal) on Heroku: </p>
  
  <blockquote>
    <p>SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "categories" does not exist LINE 1: select * from "categories" ^ (SQL: select * from "categories")</p>
  </blockquote>
  
  <p>In my terminal, below this error, I have an Undefined table error stating that my categories table doesn't exist. This so frustrating because it does exist and it's right there! Can someone help with this? Has anyone had a similar Issue? </p>
  
  <p>Tried: </p>
  
  <ul>
  <li>Rollback tables: heroku run php artisan migrate:rollback</li>
  <li>migrate fresh: heroku run php artisan migrate:fresh</li>
  <li>migrate reset: heroku run php artisan migrate:reset</li>
  </ul>
  
  <p>The migrations run up until the stories table where the relationship is located and then stop running. Right below stories is the categories table. I don't know how much this helps in fining a solution.</p>
  
  <p>stories table:</p>
  
  <pre class="lang-php prettyprint-override"><code>        &lt;?php
  
      use Illuminate\Database\Migrations\Migration;
      use Illuminate\Database\Schema\Blueprint;
      use Illuminate\Support\Facades\Schema;
  
      class CreateStoriesTable extends Migration
      {
          /**
           * Run the migrations.
           *
           * @return void
           */
          public function up()
          {
              Schema::create('stories', function (Blueprint $table) {
                  $table-&gt;bigIncrements('id');
                  $table-&gt;string('title');
                  $table-&gt;text('story');
                  $table-&gt;date('published_on');
                  $table-&gt;integer('count_views')-&gt;default(0);
                  $table-&gt;unsignedBigInteger('user_id');
                  $table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users')-&gt;onDelete('cascade');
                  $table-&gt;unsignedBigInteger("category_id");
                  $table-&gt;foreign('category_id')-&gt;references('id')-&gt;on('categories')-&gt;ondDelete('cascade');
                  $table-&gt;timestamps();
              });
          }
  
          /**
           * Reverse the migrations.
           *
           * @return void
           */
          public function down()
          {
              Schema::dropIfExists('stories');
          }
      }
  
  </code></pre>
  
  <p>categories table: </p>
  
  <pre class="lang-php prettyprint-override"><code>    &lt;?php
  
      use Illuminate\Database\Migrations\Migration;
      use Illuminate\Database\Schema\Blueprint;
      use Illuminate\Support\Facades\Schema;
  
      class CreateCategoriesTable extends Migration
      {
          /**
           * Run the migrations.
           *
           * @return void
           */
          public function up()
          {
              Schema::create('categories', function (Blueprint $table) {
                  $table-&gt;bigIncrements('id');
                  $table-&gt;string('category');
                  $table-&gt;string('title')-&gt;nullable();
                  $table-&gt;string('img')-&gt;nullable();
                  $table-&gt;timestamps();
              });
          }
  
          /**
           * Reverse the migrations.
           *
           * @return void
           */
          public function down()
          {
              Schema::dropIfExists('categories');
          }
      }
  </code></pre>
  
  <p>Story model:</p>
  
  <pre class="lang-php prettyprint-override"><code>        &lt;?php
  
      namespace App;
  
      use Illuminate\Database\Eloquent\Model;
      use App\Reviews;
      use App\User;
      use App\Category;
      use App\ReadingList;
  
      class Story extends Model
      {
  
          protected $guarded = [];
  
          public function readingList()
          {
              return $this-&gt;belongsTo(ReadingList::class);
          }
  
          public function category()
          {
              return $this-&gt;belongsTo(Category::class);
          }
  
          public function reviews() {
              return $this-&gt;hasMany(Reviews::class);
          }
  
          public function user() {
              return $this-&gt;belongsTo(User::class);
          }
  
      }
  </code></pre>
  
  <p>Category model: </p>
  
  <pre class="lang-php prettyprint-override"><code>    &lt;?php
  
      namespace App;
  
      use Illuminate\Database\Eloquent\Model;
  
      use App\Story;
  
      class Category extends Model
      {
          protected $guarded = [];
  
          public function story() 
          {
              return $this-&gt;hasMany(Story::class);
          }
  
      }
  
  </code></pre>
  
  <p>Been fixated on this for days, maybe you guys can see something I don't. Thank you so much in advance. </p>