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

from ppms.migration.packet import *

class DeleteIndicesAndConstraintsFromAG(ChangeDTPPacket):
    '''
    MOD001054 Indices and Constraints has to be deleted from workarea due to deactivation of DT320
    '''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 10638
    
    def fix(self, runner):
        primary_keys = ['01100059','001054',1214]
        
        record = self.get_record(515, primary_keys ,[10327])
        if not record: return self.fail()
        if record.delete(): return self.success()
        