# -*- coding: latin-1 -*-
from ppms.migration import SQLPacket, PacketCategory, MinVersionDependency, MaxVersionDependency, VersionType


class DI001363changeVRtoPython(SQLPacket):
    ''' Changes the value range of DI001363 to computeOutput'''
    wi_number = 9959
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    
    sql_file = "WI9959_change_DI001363_vr_to_python.sql"

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

    def fix(self, runner):
        self.apply_dml_file(self.sql_planta_de_dbms, self.sql_file)
        
        return self.success()