Example #1
0
    def execute(my):    
        search_type_obj = SearchType.get(my.search_type)
        database = search_type_obj.get_database()
        table = search_type_obj.get_table()

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

        # log it first before committing to get the corrent from and to data type
        AlterTableUndo.log_modify(database,table, my.attr_name, \
             my.data_type, not my.nullable)
        alter.commit()
Example #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()