# -*- coding: utf-8 -*-
from ppms import ppms, constants
from ppms.migration.packet import *

class ModifyColumnLength(SQLPacket):
    '''Increase the size of the department resource column'''
    version = 1
    run_on_startup = True
    done_after_success = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 9720

    def fix(self, runner):
        if ppms.db_get_dbms_name() == constants.DBMS_ORACLE:
            self.modify_and_log("alter table dt511 modify (DI010633 varchar2(20))")
        elif ppms.db_get_dbms_name() == constants.DBMS_MSSQL:
            self.modify_and_log("alter table dt511 alter column DI010633 varchar(20)")


        return self.success()