remove contact table
This commit is contained in:
@@ -17,11 +17,10 @@ class User(Base):
|
||||
fullname: Mapped[str] = mapped_column()
|
||||
role: Mapped[str] = mapped_column(default=UserRole.USER.value)
|
||||
phone: Mapped[str] = mapped_column(nullable=True)
|
||||
|
||||
email: Mapped[str] = mapped_column(nullable=True)
|
||||
events = relationship("UserEvent", back_populates="user_rel")
|
||||
certificates = relationship("Certificate", back_populates="user_rel")
|
||||
addresses = relationship("Address", back_populates="user_rel")
|
||||
contacts = relationship("Contact", back_populates="user_rel")
|
||||
|
||||
|
||||
class Event(Base):
|
||||
@@ -87,14 +86,4 @@ class Address(Base):
|
||||
extended_address: Mapped[str] = mapped_column()
|
||||
postal_code: Mapped[str] = mapped_column()
|
||||
|
||||
user_rel = relationship("User", back_populates="addresses")
|
||||
|
||||
|
||||
class Contact(Base):
|
||||
__tablename__ = "contact"
|
||||
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
|
||||
user_id: Mapped[int] = mapped_column(ForeignKey("user.id"))
|
||||
type: Mapped[str] = mapped_column()
|
||||
value: Mapped[str] = mapped_column()
|
||||
|
||||
user_rel = relationship("User", back_populates="contacts")
|
||||
user_rel = relationship("User", back_populates="addresses")
|
||||
Reference in New Issue
Block a user