Esempio n. 1
0
 def setUp(self):
     self.db_name = parent_node_dict["database"][-1]["db_name"]
     schema_info = parent_node_dict["schema"][-1]
     self.server_id = schema_info["server_id"]
     self.db_id = schema_info["db_id"]
     db_con = database_utils.connect_database(self, utils.SERVER_GROUP,
                                              self.server_id, self.db_id)
     if not db_con['data']["connected"]:
         raise Exception("Could not connect to database to add a table.")
     self.schema_id = schema_info["schema_id"]
     self.schema_name = schema_info["schema_name"]
     schema_response = schema_utils.verify_schemas(self.server,
                                                   self.db_name,
                                                   self.schema_name)
     if not schema_response:
         raise Exception("Could not find the schema to add a table.")
     self.table_name = "table_column_%s" % (str(uuid.uuid4())[1:6])
     self.table_id = tables_utils.create_table(self.server, self.db_name,
                                               self.schema_name,
                                               self.table_name)
     self.column_name = "test_column_delete_%s" % (str(uuid.uuid4())[1:6])
     self.column_id = columns_utils.create_column(self.server, self.db_name,
                                                  self.schema_name,
                                                  self.table_name,
                                                  self.column_name)
     self.index_name = "test_index_delete_%s" % (str(uuid.uuid4())[1:6])
     self.index_id = indexes_utils.create_index(self.server, self.db_name,
                                                self.schema_name,
                                                self.table_name,
                                                self.index_name,
                                                self.column_name)
Esempio n. 2
0
 def setUp(self):
     self.db_name = parent_node_dict["database"][-1]["db_name"]
     schema_info = parent_node_dict["schema"][-1]
     self.server_id = schema_info["server_id"]
     self.db_id = schema_info["db_id"]
     db_con = database_utils.connect_database(self, utils.SERVER_GROUP,
                                              self.server_id, self.db_id)
     if not db_con['data']["connected"]:
         raise Exception("Could not connect to database to add a table.")
     self.schema_id = schema_info["schema_id"]
     self.schema_name = schema_info["schema_name"]
     schema_response = schema_utils.verify_schemas(self.server,
                                                   self.db_name,
                                                   self.schema_name)
     if not schema_response:
         raise Exception("Could not find the schema to add a table.")
     self.table_name = "table_column_%s" % (str(uuid.uuid4())[1:8])
     self.table_id = tables_utils.create_table(self.server, self.db_name,
                                               self.schema_name,
                                               self.table_name)
     self.column_name = "test_column_delete_%s" % (str(uuid.uuid4())[1:8])
     self.column_id = columns_utils.create_column(self.server,
                                                  self.db_name,
                                                  self.schema_name,
                                                  self.table_name,
                                                  self.column_name)
     self.index_name = "test_index_delete_%s" % (str(uuid.uuid4())[1:8])
     self.index_id = indexes_utils.create_index(self.server, self.db_name,
                                                self.schema_name,
                                                self.table_name,
                                                self.index_name,
                                                self.column_name)