MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / B

Class B

test/orm/test_dynamic.py:1510–1519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1508 )
1509
1510 class B(decl_base):
1511 __tablename__ = "b"
1512 id: Mapped[int] = mapped_column(Identity(), primary_key=True)
1513 a_id: Mapped[int] = mapped_column(
1514 ForeignKey(
1515 "a.id",
1516 ondelete="cascade" if cascade_deletes else "set null",
1517 ),
1518 nullable=not cascade_deletes,
1519 )
1520
1521 decl_base.metadata.create_all(connection)
1522 return A, B

Callers 2

test_remove_orphansMethod · 0.70

Calls 3

mapped_columnFunction · 0.90
IdentityClass · 0.90
ForeignKeyClass · 0.90

Tested by 2

test_remove_orphansMethod · 0.56