def METHOD_NAME(apps, schema_editor):
    history_entry_sql_def_contraints = get_constraints_def_sql("history_historyentry")
    history_entry_sql_def_indexes = get_indexes_def_sql("history_historyentry")
    history_change_notifications_sql_def_contraints = get_constraints_def_sql("notifications_historychangenotification_history_entries")
    drop_constraints("notifications_historychangenotification_history_entries")
    cursor = connection.cursor()
    cursor.execute("""
        DELETE FROM notifications_historychangenotification_history_entries;
        DROP TABLE history_historyentry;
        ALTER TABLE "history_historyentry_correct" RENAME to "history_historyentry";
    """)
    for history_entry_sql_def_contraint in history_entry_sql_def_contraints:
            cursor.execute(history_entry_sql_def_contraint)
    for history_entry_sql_def_index in history_entry_sql_def_indexes:
            cursor.execute(history_entry_sql_def_index)
    # Restoring the dropped constraints and indexes
    for history_change_notifications_sql_def_contraint in history_change_notifications_sql_def_contraints:
            cursor.execute(history_change_notifications_sql_def_contraint)