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


class AddProjectPoolTable(SQLPacket):
    """Add the project pool table for the interface"""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 16240

    sql_script = 'wi16240_create_project_pool.sql'

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

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

        return self.success()