postgresql-9.2

Creating partial unique index with sqlalchemy on Postgres

Creating partial unique index with sqlalchemy on Postgres Question: SQLAlchemy supports creating partial indexes in postgresql. Is it possible to create a partial unique index through SQLAlchemy? Imagine a table/model as so: class ScheduledPayment(Base): invoice_id = Column(Integer) is_canceled = Column(Boolean, default=False) I’d like a unique index where there can be only one “active” ScheduledPayment for …

Total answers: 3