public function afterVersionedSave()
    {
        if ($this->wasDirty && static::$createRevisionOnSave) {
            // save a copy to history table
            $recordValues = $this->_prepareRecordValues();
            $set = static::_mapValuesToSet($recordValues);
            DB::nonQuery(
                'INSERT INTO `%s` SET %s',
                [
                    static::getHistoryTable(),
                    join(',', $set),
                ]
            );
        }
    }