即使遵循迁移过程,我也无法从laravel向表中添加新列?

I am following all the steps for adding new column votes to the user table from laravel, still there isn't in the database? Please tell me where is my mistake? Firstly php artisan make:migration add_votes_to_users_table --table=users

public function up()
{
    Schema::table('users', function (Blueprint $table) {
         $table->integer('votes');
    });
}

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::table('users', function (Blueprint $table) {
        $table->dropColumn('votes');
    });
}
php artisan migrate

enter image description here

Error from cmd- In Connection.php line 647:

SQLSTATE[42S01] And In Connection.php line 449:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists

查看全部
dongmi4734
dongmi4734
2018/11/13 08:12
  • php
  • 点赞
  • 收藏
  • 回答
    私信

4个回复