# -*- coding: utf-8 -*-
import os

from ppms.migration.packet import *
from ppms import ppms

class AddMessageSizeToPC(SQLPacket):
    '''Adds message size for sent/received messages to the performance counter module and table
    
    Changes DT324+MOD001251.
    '''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 11366

    sql_filename = 'wi11366_message_size_pc.sql'

    def fix(self, runner):
        sqlpath = self.get_sql_file_path(self.sql_planta_de_dbms, self.sql_filename)
        queries = self.get_queries_from_file(sqlpath)

        for query in queries:
            self.modify_and_log(query)

        return self.success()