'SQLAlchemy model inheritance without relations
I want to create two similar tables. I need not to create any realtions between them.
class Table1(Base):
__tablename__ = "table1"
id = Column(UUIDType, primary_key=True, index=True, unique=True)
value = Column(String(70), nullable=True)
class Table2(Table1):
__tablename__ = "table2"
unit = Column(String(10), nullable=True)
But when I try to use that models I get
E sqlalchemy.exc.NoForeignKeysError: Can't determine the inherit condition between inherited table 'table1' and inheriting table 'table2';
Is it possible to refuse automatic creation of the relations without abstract class usage?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
