from ppms.migration import SQLPacket, PacketCategory, MaxVersionDependency


class SetParallelSessionsToDefault(SQLPacket):
    """Set Parallel Sessions of users To Default (3)"""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 20318

    sql_script = 'WI20318_set_parallel_sessions_to_default.sql'

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

    def fix(self, packet_runner):
        self.apply_dml_file(self.sql_planta_de_ansi, self.sql_script)

        return self.success()