<?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/ja/tags/laravel/</link><description>Recent content in Laravel on Lin's Blog</description><generator>Hugo</generator><language>ja-JP</language><lastBuildDate>Mon, 12 Dec 2016 04:57:46 +0000</lastBuildDate><atom:link href="https://coder.tw/ja/tags/laravel/index.xml" rel="self" type="application/rss+xml"/><item><title>Laravel Artisan の migrate で出る「Table Already Exists」「Foreign Key」エラー</title><link>https://coder.tw/ja/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/ja/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 エラーが出ることです。しかし、そのテーブルを作成した覚えは一度もありません。詳しく調べると、テーブル自体は存在していたのですが、project_migrations テーブルにはその記録がありませんでした。そこでテーブルを手動で削除してから、もう一度 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>