code: public function upgrade()
      {
          /* @var $owner BaseActiveRecord */
          $owner = $this->owner;
          if ($owner->getIsNewRecord()) {
              throw new InvalidCallException('Upgrading the model version is not possible on a new record.');
          }
          $lock = $this->getLockAttribute();
          $version = $owner->$lock ?: 0;
          $owner->updateAttributes([$lock => $version + 1]);
      }
docs: Upgrades the version value by one and stores it to database.
  
  ```php
  $model->upgrade();
  ```
  @throws InvalidCallException if owner is a new record.
  @since 2.0.16