Add a few more database tables & made the api pull from the database

when then article exists & not ddos line today, Also made a basic
newsView with the api & the scraping script now scraps more stuff! :D
This commit is contained in:
yuanhau 2025-05-18 11:59:58 +08:00
parent fe5e2d996e
commit b62a3cda3d
6 changed files with 84 additions and 40 deletions

View file

@ -38,13 +38,13 @@ CREATE TABLE IF NOT EXISTS chat_history (
const newsArticles = await sql`
create table if not exists news_articles (
uuid text primary key,
title text not null,
content text not null,
news_org text not null,
origin_link text not null,
author text,
related_uuid text not null
uuid text primary key,
title text not null,
content text not null,
news_org text not null,
origin_link text not null,
author text,
related_uuid text not null
)
`;
@ -59,6 +59,16 @@ create table if not exists hot_news (
)
`;
const articlesLt = await sql`
create table if not exists articles_lt (
uuid text primary key,
title text not null,
content text not null,
origin text not null,
author text,
)
`;
console.log("Creation Complete");
await sql.end();