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

class SetDistriblistEmpty(SQLPacket):
    '''Set Distriblist (DI000912) to empty in DT405 cause it´s not used anymore'''
    wi_number = 14855
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY

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

    def fix(self, runner):
        self.modify_and_log("""UPDATE DT405 SET DI000912 = Null """)

        return self.success()