title: Laravel Error : SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'categories' already exists
body: <p>I cant figure out what the problem is, the 2 tables are not connecting for some reason, I read many articles and tried many things still not working.</p>
  
  <p>I want to link post and category tables together, so when I can display the category chosen in the post made.</p>
  
  <pre><code>  public function up()
      {
          Schema::create('posts', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;timestamps();
              $table-&gt;string('name');
              $table-&gt;text('description');
              $table-&gt;integer('category_id');
              $table-&gt;integer('price');
              $table-&gt;integer('currency_id');
          });
      }
  </code></pre>
  
  <p>Category</p>
  
  <pre><code> public function up()
      {
          Schema::create('categories', function (Blueprint $table) {
              $table-&gt;id();
              $table-&gt;timestamps();
              $table-&gt;string('name');
              $table-&gt;bigInteger('post_id')-&gt;unsigned();
              $table-&gt;foreign('post_id')-&gt;references('id')-&gt;on('posts');
          });
      }
  </code></pre>
  
  <p>This is the error I get:</p>
  
  <blockquote>
    <p>SQLSTATE[42S01]: Base table or view already exists: 1050 Table
    'categories' already exists (SQL: create table <code>categories</code> (<code>id</code>
    bigint unsigned not null auto_increment primary key, <code>created_at</code>
    timestamp null, <code>updated_at</code> timestamp null, <code>name</code> varchar(255) not
    null, <code>post_id</code> bigint unsigned not null) default character set
    utf8mb4 collate 'utf8mb4_unicode_ci')</p>
  </blockquote>