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

from ppms.migration.packet import *


class FixEventTimeDIs(SQLPacket):
    '''Changes DataItem Customizing to reflect server changes w.r.t. performance counting
    
    Changes DT324 customizing
    '''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 13058

    SQL = 'wi13058_pc_di_customizing.sql'

    def fix(self, runner):
        sqlpath = self.get_sql_file_path(self.sql_planta_de_dbms, self.SQL)

        queries = self.get_queries_from_file(sqlpath)

        for query in queries:
            self.modify_and_log(query)

        return self.success()