15👍
✅
Multiple rows with NULL values should not be a problem for the unique constraint. Only “values” must be unique, NULL is no value.
Have you tried?:
upc = Column(String(), unique=True, nullable=True)
Source:stackexchange.com