feat(trash): SoftDeleteMixin applied to the 7 soft-deletable models
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user