doulao3078 2018-12-03 20:57
浏览 98

Laravel migrate:刷新在Composer更新后不起作用

The command in the title return error message below:

Type error: Too few arguments to function Illuminate\Database\Schema\Builder::create(), 1 passed in C:\xampp7\htdocs\assurance-web\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 221 and exactly 2 expected

I installed the framework with the commands:

composer create-project --prefer-dist laravel/laravel assurance-web
version 5.7

Then executed:

php artisan make:migration create_banks_table --create=banks

I was able to run php artisan migrate with no errors. However, then when I run php artisan migrate:refresh I get the error above.

This is "2018_12_04_033726_create_table_banks.php":

<?php

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

class CreateBanksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('banks', function(Blueprint $table) {
            $table->increments('id');
            $table->string('bank_name');
            $table->string('bank_code');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('banks');
    }
}
  • 写回答

1条回答 默认 最新

  • doure5236 2018-12-03 21:12
    关注

    Maybe your migration table is compromised. You can use:

    php artisan migrate:fresh
    

    instead of "php artisan migrate:refresh" and the migration will see that it will work.

    The "php artisan migrate:fresh" command physically deletes all tables instead of rolling back.

    评论

报告相同问题?

悬赏问题

  • ¥15 求帮我调试一下freefem代码
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图