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


class PortYYYYMMDDFormat(SQLPacket):
    """Port the date format "YYYYMMDD" into the system"""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 12899

    FILENAME = 'wi12899_sap_date_format.sql'

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

    def fix(self, runner):
        self.apply_dml_file(self.sql_planta_de_dbms, self.FILENAME)

        return self.success()