# -*- coding: utf-8 -*-
from ppms.migration.packet import *
from ppms.migration import ChangeDTPPacket, MinVersionDependency, MaxVersionDependency

class Entity(SQLPacket, ChangeDTPPacket):
    '''Creates a new column “Entity Name” in DT415
 
    Adds this DI as mandatory DI to “Data Dictionary” and “PLANTA Datentabelle” modules and sets this DI for all not customer tables
 
    Preparation for HQL
    '''
    
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 12349

    fname = 'wi12349_entity_names.sql'

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

    def fix(self, runner):
        self.apply_dml_file(self.sql_planta_de_dbms, self.fname)
        return self.success()
