from ppms.migration import SQLPacket, PacketCategory, MaxVersionDependency, VersionType


class AddIndexToDt468(SQLPacket):
    """Adding an index to DT468 for performance enhancements"""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 20365

    sql_script = 'WI20365_add_index_to_dt468.sql'

    def get_dependencies(self):
        return MaxVersionDependency(version='39.5.9',),

    def fix(self, packet_runner):
        self.apply_fix_ddl_file(self.sql_planta_de_dbms, self.sql_script, split=True)

        return self.success()
