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


class PortDistributePMEffortMessage(SQLPacket):
    """Adds the message that tells the user that currently effort can't be distributed for PM load porfiles."""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 21003

    sql_script = 'WI21003_distribute_pm_effort_message.sql'

    def get_dependencies(self):
        return MaxVersionDependency(version='39.5.10', version_type=VersionType.CUSTOMIZING),

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

        return self.success()
