Skip to content

Commit 85854cf

Browse files
committed
fix: add keywords column to Document model and database migrations to fix 500 error on list documents
1 parent 61e34f9 commit 85854cf

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

backend/app/database.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def _migrate_schema():
198198
("documents", "processing_started_at", "ALTER TABLE documents ADD COLUMN processing_started_at TIMESTAMP"),
199199
("documents", "completed_at", "ALTER TABLE documents ADD COLUMN completed_at TIMESTAMP"),
200200
("documents", "extracted_urls", "ALTER TABLE documents ADD COLUMN extracted_urls TEXT"),
201+
("documents", "keywords", "ALTER TABLE documents ADD COLUMN keywords TEXT"),
201202
]
202203
for table, column, ddl in docs_migrations:
203204
if column not in existing_docs_columns:

backend/app/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ class Document(Base):
355355
processing_started_at = Column(DateTime, nullable=True)
356356
completed_at = Column(DateTime, nullable=True)
357357
extracted_urls = Column(Text, nullable=True)
358+
keywords = Column(Text, nullable=True)
358359

359360
# Relationships
360361
owner = relationship("User", back_populates="documents")

0 commit comments

Comments
 (0)