dtmm0148603 2014-03-10 03:42
浏览 60

我的一次迁移没有在Laravel 4中使用php artisan命令运行

I have several migrations I am running in Laravel 4. I use the php artisan migrate:rollback and php artisan migrate commands to populate the tables. Interestingly enough, one of my migrations has stopped working (cannot roll back). All of the others are working fine. I haven't changed anything to my knowledge.

The migration in question is named: 2013_06_19_050252_create_artists_table.php

And it looks like so:

    <?php

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

class CreateArtistsTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('artists', function(Blueprint $table) {
            $table->increments('id');
            $table->string('url_tag')->unique();
            $table->string('username');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('artists');
    }

}

I have no idea why this isn't working. Any ideas what could be going on?

  • 写回答

3条回答 默认 最新

  • douci1851 2014-03-19 19:28
    关注

    When you have problems with your migrations, sometimes

    php artisan migrate:refresh
    

    But if your migrations are really broken, and it happens sometimes, you may have to delete all your database tables and then run php artisan migrate again.

    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集