This "values={'extra':''}" repeats a lot. It should be a default argument (if not for _create_db_constraint_sql itself, then for a thin wrapper around it).