/** * Constructor * * @param string $connection the db connection to be used * @param boolean $autoInit If true, the schema_migrations table will be initialized automatically. * @return Migrations */ public function __construct($connection = 'default', $autoInit = true) { $this->connection = $connection; $this->SchemaMigration = ClassRegistry::init('Migrations.SchemaMigration'); $this->SchemaMigration->setDataSource($this->connection); if ($autoInit !== false) { $this->_initSchemaMigrations(); } }