示例#1
0
def drop_tables():
  print 'Dropping tables'
  db, cursor = mysql_util.init_db()
  tables_to_be_removed = mysql_util.get_all_tbl(db, cursor)
  for tbl in tables_to_be_removed:
    mysql_util.drop_tbl(db, cursor, tbl)
  mysql_util.close_db(db, cursor)
示例#2
0
def reset_tables_for_testing(db, cursor):
  tables_to_be_removed = [ 'ngram_relations', 'personal_keywords', 'root_categories']
  for tbl in tables_to_be_removed:
    drop_tbl(db, cursor, tbl)
  reset_ngram_freq(db, cursor)