📜  sqlalchemy 两列中的一列必须不为空 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:17.199000             🧑  作者: Mango

代码示例1
class BudgetCategories(Base):
    __tablename__ = 'budget_categories'
    # ...

    # @note: new
    __table_args__ = (
            CheckConstraint('NOT(category IS NULL AND parent_category IS NULL)'),
            )