# -*- coding: UTF-8 -*-

from ppms.migration import MaxVersionDependency, SQLPacket, PacketCategory


class MemoryLimitMessages(SQLPacket):
    '''Adds messages that informs user about low memory situations'''
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 13208

    def get_dependencies(self):
        return (MaxVersionDependency('39.5.6'), )

    def fix(self, runner):
        file = 'wi13208_memory_limit_messages.sql'

        self.apply_dml_file(self.sql_planta_de_dbms, file)

        return self.success()