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

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

class MakeSymbolTypeServerRelevant(SQLPacket):
    '''Necessary to serialize symbol type to client (to display bar type symbols correctly)'''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 1788

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

    def fix(self, runner):
        ppms.db_modify(QUERY)

        return self.success()
