def get_fk(from_table, to_table):
    """
    Gets all foreign keys on *to_table* referencing *from_table*
    """
    foreign_keys = []
    for foreign_key in to_table.foreign_keys:
        if foreign_key.column.table == from_table:
            foreign_keys.append(foreign_key)
    return foreign_keys
