web_search/models.py

24 lines
617 B
Python
Raw Permalink Normal View History

2024-12-19 03:32:54 +00:00
from sqlalchemy import Table, Column, Integer, String, MetaData, Text, DateTime, Boolean
metadata = MetaData()
search_results = Table(
"search_results",
metadata,
Column("id", Integer, primary_key=True),
Column("engine", String(50)),
Column("query", String(255)),
Column("results", Text),
Column("search_datetime", DateTime),
Column("is_processed", Boolean, default=False)
)
user_queries = Table(
"user_queries",
metadata,
Column("id", Integer, primary_key=True),
Column("query", Text),
Column("query_datetime", DateTime),
Column("result_count", Integer),
)