This commit is contained in:
@@ -17,5 +17,5 @@ class EmergencyContact(BaseModel):
|
||||
relation_type = Column(String(50)) # Переименовано из relationship в relation_type
|
||||
notes = Column(Text)
|
||||
|
||||
# Отношение к пользователю
|
||||
user = orm_relationship("User", back_populates="emergency_contacts")
|
||||
# Отношение к пользователю (без back_populates для избежания циклических зависимостей)
|
||||
user = orm_relationship("User")
|
||||
@@ -23,8 +23,8 @@ class User(BaseModel):
|
||||
avatar_url = Column(String)
|
||||
bio = Column(Text)
|
||||
|
||||
# Отношения
|
||||
emergency_contacts = relationship("EmergencyContact", back_populates="user", cascade="all, delete-orphan")
|
||||
# Отношения (используем lazy import для избежания циклических зависимостей)
|
||||
# emergency_contacts = relationship("EmergencyContact", back_populates="user", cascade="all, delete-orphan")
|
||||
|
||||
# Emergency contacts
|
||||
emergency_contact_1_name = Column(String(100))
|
||||
|
||||
Reference in New Issue
Block a user