首页 > 解决方案 > Laravel 迁移工作但没有做任何事情

问题描述

laravel 6.20.29
mysql 14.14
服务器 Linux (Ubuntu 18.04.3 LTS)

在我的一个aws实例中部署我的代码时,所有迁移都执行了,但有些迁移在数据库中什么也没做,没有显示任何错误(仅显示成功消息),尽管在其他实例和本地它都有效,但任何人都曾遇到过任何事情像那样?

迁移之一:

class ModifyDispensacoesTable extends Migration
{
    public function up()
    {
        Schema::table('dispensacoes', function (Blueprint $table) {
            $table->integer('estoque_triagem_id')->unsigned()->nullable()->after('produtos_lote_id');
            $table->integer('estoque_atendimento_id')->unsigned()->nullable()->after('estoque_triagem_id');

            $table->foreign('estoque_triagem_id')->references('id')->on('estoques_triagens');
            $table->foreign('estoque_atendimento_id')->references('id')->on('estoques_atendimentos');
        });
    }

    public function down()
    {
        Schema::table('dispensacoes', function (Blueprint $table) {
            $table->dropForeign('dispensacoes_estoque_triagem_id_foreign');
            $table->dropColumn('estoque_triagem_id');
            $table->dropForeign('dispensacoes_estoque_atendimento_id_foreign');
            $table->dropColumn('estoque_atendimento_id');
        });
    }
}

标签: phpmysqllaravelmigration

解决方案


推荐阅读