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

class AdjustPLANTALinkSchemaVoE(SQLPacket):
    '''Adjust the PLANTA Link schema in VoE to fit the Venus schema'''
    version = 1
    run_on_startup = True
    done_after_success = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 13329

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

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

        return self.success()