src/Db/Migration.php
public function init()
    {
        parent::init();
        $this->db = Instance::ensure($this->db, DatabaseInterface::class);
    }
public function init()
    {
        parent::init();
        $this->db = Instance::ensure($this->db, DatabaseInterface::class);
    }
Initializes the migration.
This method will set [[db]] to be the 'db' application component, if it is `null`.