public function migrateModels($models)
    {
        // run inside callback
        $this->set(function ($c) use ($models) {
            $c->notice('Preparing to migrate models');
            $p = $c->app->db;

            foreach ($models as $model) {
                if (!is_object($model)) {
                    $model = $this->factory($model);
                    $p->add($model);
                }

                $m = new \atk4\schema\Migration\MySQL($model);
                $result = $m->migrate();

                $c->debug('  '.get_class($model).'.. '.$result);
            }

            $c->notice('Done with migration');
        });
    }
public function migrateModels($models)
    {
        // run inside callback
        $this->set(function ($c) use ($models) {
            $c->notice('Preparing to migrate models');
            $p = $c->app->db;

            foreach ($models as $model) {
                if (!is_object($model)) {
                    $model = $this->factory($model);
                    $p->add($model);
                }

                $m = new \atk4\schema\Migration\MySQL($model);
                $result = $m->migrate();

                $c->debug('  '.get_class($model).'.. '.$result);
            }

            $c->notice('Done with migration');
        });
    }
public function migrateModels ( $ models ) { // run inside callback $ this -> set ( function ( $ c ) use ( $ models ) { $ c -> notice ( 'Preparing to migrate models' ) ; $ p = $ c -> app -> db ; foreach ( $ models as $ model ) { if ( ! is_object ( $ model ) ) { $ model = $ this -> factory ( $ model ) ; $ p -> add ( $ model ) ; } $ m = new \ atk4 \ schema \ Migration \ MySQL ( $ model ) ; $ result = $ m -> migrate ( ) ; $ c -> debug ( '  ' . get_class ( $ model ) . '.. ' . $ result ) ; } $ c -> notice ( 'Done with migration' ) ; } ) ; }
Provided with array of models, perform migration for each of them.
Provided with array of models perform migration for each of them .