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


class ExtendActionID(SQLPacket):
    """Extend DI 027481 "Action-ID" so it can contain python method names"""

    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 21205

    filename_ddl = 'WI21205_extend_DI027481_action_id_ddl.sql'
    filename_dml = 'WI21205_extend_DI027481_action_id_dml.sql'
    def get_dependencies(self):
        return MaxVersionDependency(version='39.5.10', version_type=VersionType.CUSTOMIZING),

    def fix(self, packet_runner):
    
        self.apply_fix_ddl_file(self.sql_planta_de_dbms, self.filename_ddl)
        self.apply_dml_file(self.sql_planta_de_dbms, self.filename_dml)
        return self.success()