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


class AddFunctionalPortfolioId(SQLPacket):
    """Adds the functional Portfolio Id and sets default values"""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 20251

    sql_script = 'WI20251_add_functional_portfolio_id.sql'

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

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

        return self.success()
