Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

php artisan migrate:rollback is not working

it was working before what I am trying to update to MYSQL to create new as users. My MySQL is completely user name removed.

<?php

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

class CreateUsersTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('username')->unique();
            $table->string('email',200)->unique();
            $table->string('password', 255);
            $table->string('code');
            $table->integer('active');
            $table->string('remember_token');
            $table->timestamps();
        });
    }

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

}

I am using VM http://imgur.com/UFEX3R5 I have tried couple of different php artisan migrate --force php artisan migrate:rollback --force

I have no idea does it mean it s not good users migrate anymore so I have to create other new migrate name?

2 Answers

Hi Brian,

Can you check if users table exists in your database?

Also, have you changed anything in your migration file?

it was not exists in db. I was going way to far with migrate and I do not like what I was doing I cant remember what i did with those so I decided to revert on github git reset --hard HEAD^ or commit. it seems still same problem so I create new class --create=users it seem working. the old one migrate remove file to the trash. it should be fine.