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


class DeactivateVPPMSDT867DB2(SQLPacket):
    '''Fix an error message when deleting a project
 
    Therefore, a non-existing view is deactivated that is called when deleting a project.
    '''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 12799

    def fix(self, runner):
        self.modify_and_log("update dt415 set enabled = 0 where DI000265 = '082'")

        return self.success()