antonioribeiro / tracker

Laravel Stats Tracker
MIT License
2.9k stars 596 forks source link

Different Database Connection is not properly managed #62

Closed pranshu-07 closed 9 years ago

pranshu-07 commented 9 years ago

I have created different database connection for tracker but still it has taken my default mySql connection.

    'tracker' => array(
        'driver'   => 'mysql',
        'host'     => '127.0.0.1',
        'database' => 'laravel_analytics',
        'username' => 'root',
        'password' => 'xxxxxx',
        'charset'  => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix'   => '',
    )

I mentioned this connection in tracker config file but still it creates migration in default mySql connection database. Is this a bug or i'm heading towards some silly mistake??

antonioribeiro commented 9 years ago

That may not be really clear on the readme, but Tracker does not control migration, this is a Laravel thing. So you have to set your default connection to 'tracker' if you want to

php artisan migrate

Or you'll have to

php artisan migrate --database=tracker
antonioribeiro commented 9 years ago

Readme edited to provide some more information on that. Thank you.