forked from Anteros-Code-Mentoria/poc-mvc-ocr
commit
This commit is contained in:
parent
9e9d8958c1
commit
5a11434c83
16
app/models/ocr_results.py
Normal file
16
app/models/ocr_results.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from sqlalchemy import Column, String, Boolean, ForeignKey, DateTime
|
||||||
|
from sqlalchemy.dialects.postgresql import UUID
|
||||||
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
|
import uuid
|
||||||
|
from datetime import datetime, timezone
|
||||||
|
|
||||||
|
Base = declarative_base()
|
||||||
|
|
||||||
|
class OCRResult(Base):
|
||||||
|
__tablename__ = "ocr_result"
|
||||||
|
|
||||||
|
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||||
|
documento_id = Column(UUID(as_uuid=True), ForeignKey("documento.id"), unique=True, nullable=False)
|
||||||
|
caminho_texto = Column(String, nullable=True)
|
||||||
|
indexado = Column(Boolean, default=False)
|
||||||
|
criado_em = Column(DateTime, default=lambda: datetime.now(timezone.utc))
|
||||||
Loading…
Reference in New Issue
Block a user