16 lines
538 B
Python
16 lines
538 B
Python
|
|
from sqlalchemy import Column, Integer, String, ForeignKey
|
||
|
|
from sqlalchemy.orm import relationship
|
||
|
|
|
||
|
|
from models.entities.base import Base
|
||
|
|
|
||
|
|
class RedeSocial(Base):
|
||
|
|
__tablename__ = 'redes_sociais'
|
||
|
|
|
||
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||
|
|
militante_id = Column(Integer, ForeignKey('militantes.id'))
|
||
|
|
tipo = Column(String(20)) # Instagram, TikTok, Discord, etc.
|
||
|
|
identificador = Column(String(100))
|
||
|
|
|
||
|
|
# Relacionamentos
|
||
|
|
militante = relationship("Militante", back_populates="redes_sociais")
|