feat(trash): SoftDeleteMixin applied to the 7 soft-deletable models

This commit is contained in:
2026-05-28 19:54:01 -04:00
parent 84b75f7a73
commit 7f0d99d383
6 changed files with 22 additions and 11 deletions
+4 -3
View File
@@ -4,9 +4,10 @@ from sqlalchemy import BigInteger, Column, DateTime, ForeignKey, Integer, Table,
from sqlalchemy.orm import Mapped, mapped_column
from fabledassistant.models import Base
from fabledassistant.models.base import SoftDeleteMixin
class Rulebook(Base):
class Rulebook(Base, SoftDeleteMixin):
__tablename__ = "rulebooks"
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
@@ -35,7 +36,7 @@ class Rulebook(Base):
}
class RulebookTopic(Base):
class RulebookTopic(Base, SoftDeleteMixin):
__tablename__ = "rulebook_topics"
__table_args__ = (
UniqueConstraint("rulebook_id", "title", name="uq_topic_per_rulebook"),
@@ -69,7 +70,7 @@ class RulebookTopic(Base):
}
class Rule(Base):
class Rule(Base, SoftDeleteMixin):
__tablename__ = "rules"
__table_args__ = (
UniqueConstraint("topic_id", "title", name="uq_rule_per_topic"),