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


class AddAccountingPoolTable(SQLPacket):
    """Adds the accounting element pool table."""
    run_on_startup = True
    done_after_success = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 20497

    sql_script = 'WI20497_add_accounting_pool.sql'

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

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

        return self.success()
