# -*- coding: latin-1 -*-
from ppms.migration import SQLPacket, PacketCategory, MaxVersionDependency, MinVersionDependency


class FixSystemcustomizing(SQLPacket):
    ''' Fix wrong systemcustomizing from system cu message

    DTs: DT003, DT035, DT397, DT447, DT460, DT516, DT546, DT865, DT952
    '''
    wi_number = 15655
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY

    sql_file = 'wi15655_fix_systemcustomizing.sql'

    def get_dependencies(self):
        return (MaxVersionDependency(version='39.4'),
                MinVersionDependency(version='39.4'))

    def fix(self, runner):
        self.apply_dml_file(self.sql_planta_de_dbms, self.sql_file)

        return self.success()
