I am working with SQLAlchemy and MS SQL server and I would like to create a unique constraint that allows multiple NULL value.
I know that MS SQL server does not ignore the null value and considers it as violation for the UNIQUE KEY. I also know how to fix it with SQL code (see here)
But is there a way to do the same thing with SQLAlchemy directly ?
Here is my code :
class Referential(db.Model):
__tablename__ = "REFERENTIAL"
id = db.Column("ID", Integer, primary_key=True, autoincrement=True)
name = db.Column("NAME", String(100), index=True, unique=True, nullable=False)
internal_code = db.Column("INTERNAL_CODE", String(50), unique=True, index=True)
Thanks in advance