def record_version(version, set_execution_metadata=true)
      time = Time.now
      version.id ||= Cassandra::TimeUuid::Generator.new.at(time)

      if set_execution_metadata
        version.executed_at = time
        version.executor = Etc.getlogin rescue '<unknown>'
      end

      InsertVersionQuery.new(version: version).execute!
      @applied_versions = nil
    rescue StandardError => e
      version.id = nil
      version.executed_at = nil
      version.executor = nil
      raise e
    end
def record_version(version, set_execution_metadata=true)
      time = Time.now
      version.id ||= Cassandra::TimeUuid::Generator.new.at(time)

      if set_execution_metadata
        version.executed_at = time
        version.executor = Etc.getlogin rescue '<unknown>'
      end

      InsertVersionQuery.new(version: version).execute!
      @applied_versions = nil
    rescue StandardError => e
      version.id = nil
      version.executed_at = nil
      version.executor = nil
      raise e
    end
Record a version in the schema version store.
 This should only be done if the version has been sucesfully migrated
 @param [Version] The version to record
 @param [Boolean] set_execution_metadata Determines whether or not to populate
   the version object with execution tracking info (+id+, +executed_at+, and +executor+).
 @return [Boolean] whether succesfull or not
 @raises [StandardError] if version could not be recorded. If this happens,
   execution_metadata will not be preset on the version object.