# -*- coding: utf-8 -*-
import os

from ppms.migration.packet import *
       
class PortSystemFlagDIs(SQLPacket):
    '''Port new DIs to identify a system'''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 11215
    
    FNAME = 'wi11215_system_flags.sql'
    
    def fix(self, runner):
        path = self.get_sql_file_path(self.sql_planta_de_dbms, self.FNAME)
        for query in self.get_queries_from_file(path, encoding='utf-8'):
            self.modify_and_log(query)
        
        return self.success()