import json


def add_to_finished(user_id):
    """
    Add a user ID to the finished database.

    Args:
        user_id: The user ID to be added.

    Returns:
        "done" and the current database.
    """
    try:
        metadata_database = json.load(open("metadata.db"))
    except FileNotFoundError:
        metadata_database = {}
    metadata_database[user_id] = " (🏁 finished)"
    json.dump(metadata_database, open("metadata.db", "w"))
    return f"done {metadata_database}"