from sqlalchemy import DateTime, ForeignKeyConstraint, Integer, PrimaryKeyConstraint, SmallInteger, String, UniqueConstraint, text from sqlalchemy.orm import Mapped, mapped_column, relationship from sqlalchemy.orm.base import Mapped from core.database import Base class PedimentoValidation(Base): __tablename__ = 'pedimento_validation' __table_args__ = ( ForeignKeyConstraint(['pedimento_id'], ['a76.pedimentos.id'], ondelete='CASCADE', name='fk_pedimento_validation'), PrimaryKeyConstraint('id', name='pedimento_validation_pkey'), UniqueConstraint('pedimento_id', name='pedimento_validation_pedimento_id_key'), {'schema': 'a76'} ) id = mapped_column(Integer) pedimento_id = mapped_column(Integer, nullable=False) validator = mapped_column(String(3)) validation_ack = mapped_column(String(8)) pre_ack = mapped_column(String(8)) line_signature = mapped_column(String(50)) electronic_signature = mapped_column(String(999)) certificate_number = mapped_column(String(99)) validator_id = mapped_column(Integer) responsible_id = mapped_column(Integer) created_at = mapped_column(DateTime, server_default=text('CURRENT_TIMESTAMP')) pedimento: Mapped['Pedimentos'] = relationship('Pedimentos', back_populates='pedimento_validation')