qcodes/dataset/sqlite/db_upgrades/__init__.py
def perform_db_upgrade_4_to_5(conn: ConnectionPlus) -> None:
    """
    Perform the upgrade from version 4 to version 5.

    Make sure that 'snapshot' column always exists in the 'runs' table. This
    was not the case before because 'snapshot' was treated as 'metadata',
    hence the 'snapshot' column was dynamically created once there was a run
    with snapshot information.
    """
    with atomic(conn) as conn:
        pbar = tqdm(range(1), file=sys.stdout)
        pbar.set_description("Upgrading database; v4 -> v5")
        # iterate through the pbar for the sake of the side effect; it
        # prints that the database is being upgraded
        for _ in pbar:
            insert_column(conn, 'runs', 'snapshot', 'TEXT')

    Perform the upgrade from version 4 to version 5.

    Make sure that 'snapshot' column always exists in the 'runs' table. This
    was not the case before because 'snapshot' was treated as 'metadata',
    hence the 'snapshot' column was dynamically created once there was a run
    with snapshot information.
    
Perform the upgrade from version 4 to version 5.
Make sure that 'snapshot' column always exists in the 'runs' table.
Perform the upgrade from version 4 to version 5 . Make sure that ' snapshot ' column always exists in the ' runs ' table .
def perform_db_upgrade_4_to_5(conn: ConnectionPlus) -> None:
    with atomic(conn) as conn:
        pbar = tqdm(range(1), file=sys.stdout)
        pbar.set_description("Upgrading database; v4 -> v5")
        for _ in pbar:
            insert_column(conn, 'runs', 'snapshot', 'TEXT')
def perform_db_upgrade_4_to_5 ( conn : ConnectionPlus ) -> None : with atomic ( conn ) as conn : pbar = tqdm ( range ( 1 ) , file = sys . stdout ) pbar . set_description ( "Upgrading database; v4 -> v5" ) for _ in pbar : insert_column ( conn , 'runs' , 'snapshot' , 'TEXT' )
Perform the upgrade from version 4 to version 5.
Perform the upgrade from version 4 to version 5 .
"""
    Perform the upgrade from version 4 to version 5.

    Make sure that 'snapshot' column always exists in the 'runs' table. This
    was not the case before because 'snapshot' was treated as 'metadata',
    hence the 'snapshot' column was dynamically created once there was a run
    with snapshot information.
    """ # iterate through the pbar for the sake of the side effect; it # prints that the database is being upgraded
conn
ConnectionPlus