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


class ExtendColumnReportTitle(SQLPacket):
    """Changes the DT823.DI008702 to a length of 100 chars"""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 20300

    sql_script = 'WI20300_extend_column_report_title.sql'

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

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

        return self.success()
