# -*- coding: utf-8 -*-

from ppms.migration import SQLPacket, PacketCategory, MinVersionDependency, MaxVersionDependency

class PortSubclassMessage(SQLPacket):
    """Port the text constant 001827 used in the subclass creation."""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 16604

    FILENAME = 'wi16604_port_subclass_msg.sql'

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

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

        return self.success()