예제 #1
0
def drop_mysql_schema_process():
    dump_date = get_dump_date(MONGO, ARCHIVES_BASE_FOLDER)
    if is_dump_date_valid(dump_date):
        mysql = MySQL()
        db_name = f"{GHTORRENT}-{USERS_TEMP}"
        mysql.drop_database(db_name)
        mysql.disconnect()
예제 #2
0
def drop_old_database_process():
    dump_date = get_dump_date(MYSQL, ARCHIVES_BASE_FOLDER)
    previous_mysql_dump_date = get_previous_dump_date(MYSQL,
                                                      ARCHIVES_BASE_FOLDER)
    if dump_date != previous_mysql_dump_date:
        mysql = MySQL()
        db_name = f"{GHTORRENT}-{previous_mysql_dump_date}"
        mysql.drop_database(db_name)
        mysql.disconnect()