# packages/v1/administrativo/models/usuario_model.py # Gerado a partir da DDL corrigida da tabela 'usuario' from sqlalchemy import ( Column, BigInteger, # Alterado para BigInteger para usuario_id e IDs de auditoria String, DateTime, # Não há Text, Numeric ou CheckConstraint nesta DDL ) from sqlalchemy.sql import func # Importa Base do MySQL (assumindo que o caminho 'database.mysql' é o correto) from database.mysql import Base class Usuario(Base): """ Representa o modelo da tabela 'usuario' no banco de dados MySQL. Mapeia a DDL corrigida. """ __tablename__ = "usuario" # usuario_id bigint NOT NULL AUTO_INCREMENT, PRIMARY KEY usuario_id = Column(BigInteger, primary_key=True, autoincrement=True) # Campos principais (varchar) nome = Column(String(255), nullable=True) email = Column(String(255), nullable=True) username = Column(String(120), nullable=True) password = Column(String(255), nullable=True) # status varchar(1) NOT NULL DEFAULT 'A' status = Column(String(1), nullable=False, default="A") # date_register datetime NOT NULL DEFAULT CURRENT_TIMESTAMP date_register = Column(DateTime(), server_default=func.now(), nullable=False) # date_update datetime DEFAULT NULL date_update = Column(DateTime(), onupdate=func.now(), nullable=True) # usuario_id_create bigint DEFAULT NULL user_id_create = Column(BigInteger, nullable=True) # user_id_update bigint DEFAULT NULL user_id_update = Column(BigInteger, nullable=True) # Não há __table_args__ (como CheckConstraint) na DDL original def __repr__(self): """Representação legível do objeto.""" return ( f"" )