<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Laravel on Lin's Blog</title><link>https://coder.tw/en/tags/laravel/</link><description>Recent content in Laravel on Lin's Blog</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 12 Dec 2016 04:57:46 +0000</lastBuildDate><atom:link href="https://coder.tw/en/tags/laravel/index.xml" rel="self" type="application/rss+xml"/><item><title>Laravel Artisan Migrate "Table Already Exists" or "Foreign Key" Error</title><link>https://coder.tw/en/posts/laravel-artisan-migrate-table-already-exisis-or-foreign-key-error/</link><pubDate>Mon, 12 Dec 2016 04:57:46 +0000</pubDate><guid>https://coder.tw/en/posts/laravel-artisan-migrate-table-already-exisis-or-foreign-key-error/</guid><description>&lt;p&gt;While deploying a project I had developed half a year earlier with Laravel 5.2, I ran into quite a few problems. One of them: after running php artisan migrate, I got a &amp;ldquo;Table Already Exists&amp;rdquo; error. But I had never created that table before. Digging deeper, I found that the table did exist, but there was no record for it in the project_migrations table. So I deleted the table manually and ran php artisan migrate once more. Sure enough, this time the real error message appeared: &amp;ldquo;General error: 1005 Can&amp;rsquo;t create table &amp;lsquo;dbname.#sql-fbc1_15e6&amp;rsquo; (errno: 121) (SQL: alter table &lt;code&gt;karl_project&lt;/code&gt; add constraint &lt;code&gt;project_user_id_foreign&lt;/code&gt; foreign key (&lt;code&gt;user_id&lt;/code&gt;) references &lt;code&gt;karl_user&lt;/code&gt;
(&lt;code&gt;id&lt;/code&gt;))&amp;rdquo;&lt;/p&gt;</description></item></channel></rss>