protected function createMigrationHistoryTable()
    {
        $tableName = $this->db->getSchema()->getRawTableName($this->migrationTable);
        $this->stdout("Creating migration history table \"$tableName\"...", Console::FG_YELLOW);
        $promises = [];
        $promises[] = $this->db->createCommand()->createTable($this->migrationTable, [
            'version' => 'varchar(' . static::MAX_NAME_LENGTH . ') NOT NULL PRIMARY KEY',
            'apply_time' => 'integer',
        ])->execute();
        $promises[] = $this->db->createCommand()->insert($this->migrationTable, [
            'version' => self::BASE_MIGRATION,
            'apply_time' => time(),
        ])->execute();
        return allInOrder($promises)->then(function() {
            $this->stdout("Done.\n", Console::FG_GREEN);
            return true;
        });
    }