Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User(TableMixin, Base):
- username = Column(String, nullable=False, unique=False)
- password = Column(String, nullable=False, unique=False)
- class BBTableMixin(BBTableBaseMixin):
- id = Column(Integer, primary_key=True)
- active = Column(Boolean, nullable=False, default=True)
- CREATE UNIQUE INDEX unique_active_username on user (username, active)
- where active = True;
- Index('ix_active_username', "active", username,
- unique=True,
- postgresql_where=("active" is True)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement