# -*- coding: utf-8 -*-
from ppms.migration import SQLPacket, PacketCategory, MaxVersionDependency, VersionType, PacketState, PacketDependency

PACKET_PATH = 'migration.hotfix.S_39_5_4.wi11533_port_universal_interface_VoE.PortCustomizingUniversalInterface'


class PortMandatoryValidatorTextConstants(SQLPacket):
    """Port text constants for the new mandatory validator"""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 13270

    FILENAME = 'wi13270_mandatory_validator.sql'

    def get_dependencies(self):
        return (PacketDependency(packet_path=PACKET_PATH, expected_state=PacketState.INSTALLED),
                MaxVersionDependency(version='39.5.3', version_type=VersionType.CUSTOMIZING))

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

        return self.success()