protected function addForeign($key, $ref, $col, $delete = null, $update = null)
    {
        if (empty($key)) {
            return Yii::t('podium/flash', 'Installation aborted! Foreign key name missing.');
        }
        if (empty($ref)) {
            return Yii::t('podium/flash', 'Installation aborted! Foreign key reference missing.');
        }
        if (empty($col)) {
            return Yii::t('podium/flash', 'Installation aborted! Referenced columns missing.');
        }
        try {
            $this->db->createCommand()->addForeignKey(
                    $this->getForeignName($key), $this->table, $key,
                    $this->getTableName($ref), $col, $delete, $update
                )->execute();
            return $this->returnSuccess(Yii::t('podium/flash', 'Table foreign key {name} has been added', [
                'name' => $this->getForeignName($key)
            ]));
        } catch (Exception $e) {
            return $this->returnError($e->getMessage(), __METHOD__,
                Yii::t('podium/flash', 'Error during table foreign key {name} adding', [
                    'name' => $this->getForeignName($key)
                ])
            );
        }
    }