def _collect_column_constraints(column, unique):
    """
    Collect constraints for a column.

    Use column information as well as unique constraint information.
    Note: for a unique constraint on a single column we set
          column / constraints / unique = True
          (and store all multicolumn uniques in the table realm)
    """
    res = {}
    if 'null' in column:
        res['required'] = not column['null']
    for constr_i, constr in enumerate(unique):
        if column['column_name'] in constr['fields']:
            if len(constr['fields']) == 1:
                res['unique'] = True
    return res