<?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>http://coder.tw/tags/laravel/</link><description>Recent content in Laravel on Lin's Blog</description><generator>Hugo</generator><language>zh-tw</language><lastBuildDate>Mon, 12 Dec 2016 04:57:46 +0000</lastBuildDate><atom:link href="http://coder.tw/tags/laravel/index.xml" rel="self" type="application/rss+xml"/><item><title>Laravel Artisan Migrate "Table Already Exists" or "Foreign Key" Error</title><link>http://coder.tw/posts/laravel-artisan-migrate-table-already-exisis-or-foreign-key-error/</link><pubDate>Mon, 12 Dec 2016 04:57:46 +0000</pubDate><guid>http://coder.tw/posts/laravel-artisan-migrate-table-already-exisis-or-foreign-key-error/</guid><description>&lt;p&gt;在部署半年前用 Laravel 5.2 開發的專案時遇到不少問題，其中一個就是執行 php artisan migrate 之後卻遇到 Table Already Exists 的錯誤，但在這之前我從未建立過該 Table，後來深入研究發現該 Table 確實存在但 project_migrations Table 裡面卻沒有建立紀錄，於是我將 Table 手動刪除後在直接執行一次 php artisan migrate，果然，這次出現了真正的錯誤訊息：「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;))」&lt;/p&gt;</description></item></channel></rss>