# -*- coding: utf-8 -*-
from ppms import ppms
from ppms.constants import *
from ppms.migration.packet import *

QUERY = """UPDATE DT412 SET DI027172=1 WHERE DI000238='001869'"""


class MakeOwnerLicenceServerRelevant(SQLPacket):
    '''Statement that makes sure that only customizers see customizer messages'''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 11320

    def fix(self, runner):
        # MSSQL doesn't need anything to do here, this is ok already
        if (ppms.db_get_dbms_name() == DBMS_ORACLE):
            ppms.db_modify(QUERY)

        return self.success()
