1

Newbie here. I am having trouble with my command. i have created a single laravel project with two database migration. I have followed this link to be able to accomplished my goal.

I run this code to migrate my migration in my table:

php artisan migrate --database=rms_conn --path=database/migrations/rms_conn

Now that i was migrated successfully. Now i am trying to refresh it with the command below :

php artisan migrate:refresh --database=rms_conn --path=database/migrations/rms_conn

I am getting an error that the --path doesn't exist. So can anyone help me how to run refresh,rollback in my two database? I am using laravel 5.0 this time.

I need to run the command above in my Command Class

public function fire()
    {
    $action = $this->argument('action');

    switch ($action) {
        case 'migrate':
                $conn = $this->argument('connection');
                $database = Config::get('database.connections.'.$conn.'.database');
                $this->info('Migrating "'.$conn.'" Connections. [ Database : '.$database." ]");
                $this->call('migrate', array('--database' => $conn , '--path' => 'database/migrations/' . $conn ));
            break;

        case 'refresh':
                $conn = $this->argument('connection');
                $database = Config::get('database.connections.'.$conn.'.database');
                $this->info('Migrate refreshing "'.$conn.'" Connections. [ Database : '.$database." ]");
                $this->call('migrate:refresh', array('--database' => $conn , '--path' => 'database/migrations/' . $conn ));
                #I am having an error on the line above. :(

        default:
            $this->error("Cannot found your action.");
            break;
    }


}
Community
  • 1
  • 1
Romnick Susa
  • 1,279
  • 13
  • 31
  • Is it working if you first run `artisan migrate:reset` with DB name and without path and then run `artisan migrate` with DB name and path, instead of `artisan migrate:refresh`? – thefallen Jun 17 '16 at 07:27
  • I think i need to create my own refresh function as you suggest – Romnick Susa Jun 17 '16 at 07:48

0 Answers0