Ejemplo n.º 1
0
    def execute(self):    
        search_type_obj = SearchType.get(self.search_type)
        database = search_type_obj.get_database()
        table = search_type_obj.get_table()

        alter = AlterTable(self.search_type)
        alter.drop(self.attr_name)

        # log it first before committing
        AlterTableUndo.log_drop(database,table, self.attr_name)
        alter.commit()  
Ejemplo n.º 2
0
    def execute(self):    
        search_type_obj = SearchType.get(self.search_type)
        database = search_type_obj.get_database()
        table = search_type_obj.get_table()

        alter = AlterTable(self.search_type)
        #TODO: check the varchar length and put it in
        alter.modify(self.attr_name, self.data_type, not_null=not self.nullable)

        # log it first before committing to get the corrent from and to data type
        AlterTableUndo.log_modify(database,table, self.attr_name, \
             self.data_type, not self.nullable)
        alter.commit()