fuel / auth

Fuel PHP Framework - Fuel v1.x Authentication package
http://fuelphp.com/docs/packages/auth/intro.html
76 stars 57 forks source link

db_connection wrong when run migrate php oil r migrate:down --packages=auth #74

Closed phucnh closed 10 years ago

phucnh commented 10 years ago

Action:

  1. In db.php, configuration: add another db connection (different with default) (ex: admin_db)
  2. in auth.php configuration: change Simpleauth to 'driver' => 'Ormauth'.
  3. in ormauth.php, set 'db_connection' => 'admin_db'
  4. run migrate command: migrate php oil r migrate:down --packages=auth

Except: The auth tables has been created on configured db connection (admin_db)

Actual: The auth tables has been created on database on default connection.

Suggestion: I see in task/migrations script, you don't chose the database connection. So, i think you should add $connection = \Config::get('ormauth.db_connection', null); \DBUtil::set_connection($connection);

after (line 49) $table = \Config::get('ormauth.table_name', 'users');