douhang1913
2016-07-08 12:24
浏览 26
已采纳

为什么这次迁移会被破坏? laravel 5.2

enter image description here

it fails when I try to refresh it when I delete the tables by hand and run php artisan migrate it works.

this is my migration

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateImagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('images', function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('file');
            $table->string('caption');
            $table->text('description');
            $table->integer('albumid')->unsigned();
            $table->foreign('albumid')->references('id')->on('album');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::drop('images');
    }
}
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douzhulan1815 2016-07-11 07:47
    已采纳

    Fixed it running

    composer dump-autoload
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题