This repository was archived by the owner on Sep 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,8 +44,13 @@ class Migration {
4444 * @param Database $db The database connection that should be passed to migrations
4545 * @param Model_Migration $model Inject an instance of the minion model into the manager
4646 */
47- public function __construct (Database $ db , Model_Migration $ model = NULL )
47+ public function __construct ($ db = NULL , Model_Migration $ model = NULL )
4848 {
49+ if ($ db == NULL )
50+ {
51+ $ db = Database::instance (NULL );
52+ }
53+
4954 if ($ model === NULL )
5055 {
5156 $ model = new Model_Migration ($ db );
Original file line number Diff line number Diff line change @@ -23,8 +23,13 @@ class Model_Migration extends Model
2323 *
2424 * @param Kohana_Database $db Database connection to use
2525 */
26- public function __construct (Database $ db )
26+ public function __construct ($ db = NULL )
2727 {
28+ if ($ db == NULL )
29+ {
30+ $ db = Database::instance (NULL );
31+ }
32+
2833 $ this ->_db = $ db ;
2934
3035 $ this ->_table = Config::get ('migration.table ' , 'migrations ' );
Original file line number Diff line number Diff line change @@ -93,12 +93,10 @@ protected function _execute(array $options)
9393 }
9494 }
9595
96- $ db = Database::instance ();
97- $ model = new Model_Migration ($ db );
98-
96+ $ model = new Model_Migration ();
9997 $ model ->ensure_table_exists ();
10098
101- $ manager = new Migration ($ db , $ model );
99+ $ manager = new Migration (NULL , $ model );
102100
103101 // Sync the available migrations with those in the db
104102 $ manager
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class Task_Db_Migrate_Status extends Minion_Task
1717 */
1818 protected function _execute (array $ options )
1919 {
20- $ model = new Model_Migration (Database:: instance () );
20+ $ model = new Model_Migration ();
2121 $ view = new View ('minion/db/status ' );
2222
2323 $ view ->groups = $ model ->get_group_statuses ();
You can’t perform that action at this time.
0 commit comments