CARONTE v1.0 - Plataforma de Gestão Social
This commit is contained in:
20
backend/app/models/familia.py
Normal file
20
backend/app/models/familia.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
|
||||
from sqlalchemy.sql import func
|
||||
from app.core.database import Base
|
||||
|
||||
class Familia(Base):
|
||||
__tablename__ = "familias"
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
nome = Column(String, nullable=False)
|
||||
usuario_id = Column(Integer, ForeignKey("usuarios.id"), nullable=False)
|
||||
created_at = Column(DateTime, server_default=func.now())
|
||||
|
||||
class MembroFamilia(Base):
|
||||
__tablename__ = "membros_familia"
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
familia_id = Column(Integer, ForeignKey("familias.id"), nullable=False)
|
||||
nome = Column(String, nullable=False)
|
||||
parentesco = Column(String, nullable=False)
|
||||
cpf = Column(String, nullable=True)
|
||||
telefone = Column(String, nullable=True)
|
||||
email = Column(String, nullable=True)
|
||||
Reference in New Issue
Block a user