Skip to content

Commit

Permalink
adjusting cascades and passives
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Nov 22, 2024
1 parent c3fbed4 commit 70b010d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions buildingmotif/database/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class DBModel(Base):
manifest: "DBShapeCollection" = relationship(
"DBShapeCollection",
uselist=False,
cascade="all,delete",
passive_deletes=False,
cascade="all",
passive_deletes=True,
)


Expand All @@ -54,7 +54,7 @@ class DBLibrary(Base):
name: Mapped[str] = Column(String(), nullable=False, unique=True)

templates: Mapped[List["DBTemplate"]] = relationship(
"DBTemplate", back_populates="library", cascade="all,delete", passive_deletes=False
"DBTemplate", back_populates="library", cascade="all", passive_deletes=True
)

shape_collection_id = Column(
Expand All @@ -63,8 +63,8 @@ class DBLibrary(Base):
shape_collection: DBShapeCollection = relationship(
"DBShapeCollection",
uselist=False,
cascade="all,delete",
passive_deletes=False,
cascade="all",
passive_deletes=True,
)


Expand Down Expand Up @@ -107,17 +107,17 @@ class DBTemplate(Base):
primaryjoin=id == DepsAssociation.dependant_id,
secondaryjoin=id == DepsAssociation.dependee_id,
back_populates="dependants",
cascade="all,delete",
passive_deletes=False,
cascade="all",
passive_deletes=True,
)
dependants: Mapped[List["DBTemplate"]] = relationship(
"DBTemplate",
secondary="deps_association_table",
primaryjoin=id == DepsAssociation.dependee_id,
secondaryjoin=id == DepsAssociation.dependant_id,
back_populates="dependencies",
cascade="all,delete",
passive_deletes=False,
cascade="all",
passive_deletes=True,
)

__table_args__ = (
Expand Down

0 comments on commit 70b010d

Please sign in to comment.