title: Laravel 7 General error: 1005 Can't create table `edmart`.`cancelled_ex ps` (errno: 121 "Duplicate key on write or update")
body: <p>Hi there is have looked for solutions on Stack an couldn't solve my problem.
  I am Using Laravel 7.x. At first my migrations where working properly but when i changer<code>$table-&gt;foreignId(&quot;exp_id&quot;)-&gt;constrained(&quot;expenses&quot;)-&gt;index();</code> to <code>$table-&gt;foreignId(&quot;fk_expense&quot;)-&gt;constrained(&quot;expenses&quot;)-&gt;index();</code>, it started to show this error on migration</p>
  <pre><code> SQLSTATE[HY000]: General error: 1005 Can't create table `edmart`.`cancelled_ex
   ps` (errno: 121 &quot;Duplicate key on write or update&quot;) (SQL: alter table `cancelled
   _exps` add constraint `1` foreign key (`fk_expense`) references `expenses` (`id`
   ))
  </code></pre>
  <p>Bellow are the migration file for expenses</p>
  <pre><code>   public function up(){
         Schema::create('expenses', function (Blueprint $table) {
             $table-&gt;id();
             $table-&gt;foreignId(&quot;user_id&quot;)-&gt;constrained(&quot;users&quot;)-&gt;index();
             $table-&gt;string(&quot;desc&quot;);
             $table-&gt;string(&quot;amount&quot;);
             $table-&gt;string(&quot;status&quot;);
             $table-&gt;timestamps();
         });
     }
  </code></pre>
  <p>cancelled expenses migration files</p>
  <pre><code> public function up()
     {
         Schema::create('cancelled_exps', function (Blueprint $table) {
             $table-&gt;id();
             $table-&gt;foreignId(&quot;fk_expense&quot;)-&gt;constrained(&quot;expenses&quot;)-&gt;index();
             $table-&gt;string('viewed');
             $table-&gt;timestamps();
         });
     }
  </code></pre>
  <p>I tried to remove the database and create a new one but still it failed.
  <strong>Update:</strong>
  All other migrations work properly except <code>cancelled_exps</code></p>