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


class ZZZSetDatabaseVersion(SQLPacket):
    '''Set database version to 39.5.0'''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 12510

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

    def fix(self, runner):
        self.modify_and_log("update DT345 set DI059300 = '39.5.0'")

        return self.success()