相关疑难解决方法(0)

Laravel迁移 - 一次性迁移多个迁移(文件)

说,我有多个迁移文件更新单个表.

例如

2016_03_20_072730_create_tasks_table.php
2016_03_20_075467_create_tasks_table.php

......来自不同团队成员的回购.每个人都在调整表中的内容,例如添加一列.

当我尝试:

php artisan migrate

我收到错误:

PHP Fatal error:  Cannot declare class CreateTasksTable, because the name is
eady in use in U:\www\b10\database\migrations\2016_03_20_072737_create_tasks_
le.php on line 30


  [Symfony\Component\Debug\Exception\FatalErrorException]
  Cannot declare class CreateTasksTable, because the name is already in use

如何应对如上所述的情况?

编辑

这是代码:

2016_03_20_072730_create_tasks_table.php:

class CreateTasksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
       Schema::table('tasks', function ($table)
       {
           $table->string('task1');
       });
    }

    /**
     * Reverse the migrations.
     *
     * …

php migration laravel

11
推荐指数
1
解决办法
1万
查看次数

标签 统计

laravel ×1

migration ×1

php ×1