Begin adding Postgresql support instead of filesystem flat files

This commit is contained in:
rmgr 2024-03-01 21:12:40 +10:30
parent b43343e0ee
commit 24ee04c0ff
6 changed files with 80 additions and 13 deletions

18
src/models.py Normal file
View file

@ -0,0 +1,18 @@
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.dialects.postgresql import UUID
import uuid
Base = declarative_base()
class Website(Base):
__tablename__ = 'websites'
id = Column(UUID(as_uuid=True), primary_key=True, default = uuid.uuid4)
url = Column(String)
text_content = Column(String)
html_content = Column(String)
first_crawl_date = Column(DateTime)
last_crawl_date = Column(DateTime)