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

from ppms.migration.packet import *

class AddRerunDialogMessage(SQLPacket):
    '''Port a message to confirm if you want to run packets that are marked as done'''
    version = 1
    run_on_startup = True
    done_after_success = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 11050

    fname = 'wi11050_rerun_packet_dialog_message.sql'

    def fix(self, runner):
        sqlpath = self.get_sql_file_path(self.sql_planta_de_dbms, self.fname)
        queries = self.get_queries_from_file(sqlpath)

        for query in queries:
            self.modify_and_log(query)

        return self.success()