为什么php artisan不进行任何迁移? [英] Why does php artisan migrate nothing?

查看:101
本文介绍了为什么php artisan不进行任何迁移?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行"php artisan migration"没有任何作用:没有数据库修改,没有消息(也没有什么都不能迁移"),没有错误.

Running "php artisan migrate" does nothing: no database modifications, no message(olso no "nothing to migrate"), no error.

也没有将任何记录添加到表迁移中.

No records are being added to table migrations as well.

以前,"php artisan migration"命令运行正常.

Previously, the command "php artisan migrate" was working fine.

文件夹数据库/迁移中的一个迁移文件具有以下内容:

One of the migration files in folder database/migrations has this content:

<?php

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

class VidsTableEdit14 extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('vids', function(Blueprint $table)
        {
            //
            $table->integer('test');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('vids', function(Blueprint $table)
        {
            //
        });
    }

}

如何使"php artisan migration"正常工作?

How to make "php artisan migrate" working?

推荐答案

如果迁移突然停止,那么其中一个迁移中可能存在语法错误.如果您突然遇到找不到类的错误,则可能是语法错误.

If the migration stops working suddenly there is probably a syntax error somewhere in one of your migrations. If you suddenly get a class not found error be suspicious of a syntax error.

这篇关于为什么php artisan不进行任何迁移?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆