title: Error with index when converting Laravel mysql migrations to postgresql
body: <p>I have written about 10 Laravel migrations for a MySQL database. I want to now switch out my database for a Postgresql database but am having some trouble with indexes it seems.</p>
  
  <p>I followed a tutorial about a voting module so I didnt write the migrations myself but they did all work when migrating on MySQL.</p>
  
  <p>The error im getting is as follows;</p>
  
  <pre><code>SQLSTATE[42P07]: Duplicate table: 7 ERROR:  relation "poll_id" already exists (SQL: create index "poll_id" on "gp_poll_votes" ("poll_id"))
  </code></pre>
  
  <p>There is no duplicate table and these migrations have been working for the last year or so.</p>
  
  <p>The migration it is getting stuck on is as follows;</p>
  
  <pre><code>Schema::create('gp_poll_votes', function (Blueprint $table) {
      $table-&gt;bigIncrements('id');
      $table-&gt;bigInteger('poll_id')-&gt;unsigned();
      $table-&gt;bigInteger('poll_option_id')-&gt;unsigned();
      $table-&gt;bigInteger('vote_count');
      $table-&gt;timestamps();
  
      $table-&gt;index('poll_id', 'poll_id');
      $table-&gt;index('poll_option_id', 'poll_option_id');
      $table-&gt;foreign('poll_id')-&gt;references('id')-&gt;on('gp_polls')-&gt;onDelete('cascade');
      $table-&gt;foreign('poll_option_id')-&gt;references('id')-&gt;on('gp_poll_options')-&gt;onDelete('cascade');
  });
  </code></pre>
  
  <p>There is 2 more migrations associated with the votes which are run before the erroring one, which are;</p>
  
  <pre><code>Schema::create('gp_polls', function (Blueprint $table) {
      $table-&gt;bigIncrements('id');
      $table-&gt;tinyInteger('status')-&gt;nullable(false)-&gt;default(1);
      $table-&gt;timestamps();
  });
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Schema::create('gp_poll_options', function (Blueprint $table) {
      $table-&gt;bigIncrements('id');
      $table-&gt;bigInteger('poll_id')-&gt;unsigned();
      $table-&gt;bigInteger('image_id')-&gt;unsigned();
      $table-&gt;tinyInteger('status')-&gt;nullable(false)-&gt;default(1);
      $table-&gt;timestamps();
  
      $table-&gt;index('poll_id', 'poll_id');
      $table-&gt;index('image_id', 'image_id');
      $table-&gt;foreign('image_id')-&gt;references('id')-&gt;on('gp_submit_images');
      $table-&gt;foreign('poll_id')-&gt;references('id')-&gt;on('gp_polls')-&gt;onDelete('cascade');
  });
  </code></pre>