前提・実現したいこと
php artisan migrate ```がうまくいかなくて、なやんでいます。 ### 発生している問題・エラーメッセージ
Symfony\Component\Debug\Exception\FatalErrorException : Cannot declare class CreateSessionsTable, because the name is already in use
at /Applications/MAMP/htdocs/laravelapp/database/migrations/2018_12_19_015732_create_sessions_table.php:24
20| public function down()
21| {
22| Schema::dropIfExists('sessions');
23| }
24| }
Whoops\Exception\ErrorException : Cannot declare class CreateSessionsTable, because the name is already in use
at /Applications/MAMP/htdocs/laravelapp/database/migrations/2018_12_19_015732_create_sessions_table.php:24
20| public function down()
21| {
22| Schema::dropIfExists('sessions');
23| }
24| }
### 該当のソースコード ```php <?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateSessionsTable extends Migration { public function up() { Schema::create('sessions', function (Blueprint $table) { $table->string('id')->unique(); $table->unsignedInteger('user_id')->nullable(); $table->string('ip_address', 45)->nullable(); $table->text('user_agent')->nullable(); $table->text('payload'); $table->integer('last_activity'); }); } public function down() { Schema::dropIfExists('sessions'); } }
試したこと
上記のソースコードは、
php
1php artisan session:table
で作成しました。その後マイグレーション実行のために、php artisan migrateを行うと上記のようなエラーメッセージがでてきます。DBを確認しても「session」とつけられているテーブルは作成されていないのは、確認済みです。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/12/19 07:01