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

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

class PortPeriodCreationDialogMessage(SQLPacket, ChangeDTPPacket):
    """Port the dialog message 1136 for the period creation"""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 17015

    FILENAME = 'wi17015_period_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()