mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Add postgres, made some MORE changes.
This commit is contained in:
parent
f5734e7e5d
commit
9e76ab1712
4 changed files with 1315 additions and 689 deletions
|
@ -5,10 +5,10 @@ create table if not exists users (
|
|||
uuid text primary key,
|
||||
created_at timestamptz default current_timestamp,
|
||||
username text not null unique,
|
||||
oauthProvider text not null,
|
||||
avatarUrl text not null,
|
||||
email text not null,
|
||||
oauthProviderGivenId text not null
|
||||
avatarurl text not null,
|
||||
firstname text not null,
|
||||
passwordhash text not null,
|
||||
email text not null
|
||||
);
|
||||
`;
|
||||
|
||||
|
@ -27,31 +27,6 @@ create table if not exists newsProviders (
|
|||
)
|
||||
`;
|
||||
|
||||
const createNewsProvidersZh = await sql`
|
||||
create table if not exists newsProvidersZh (
|
||||
uuid text primary key,
|
||||
title text not null,
|
||||
slug text unique,
|
||||
website text not null,
|
||||
description text not null,
|
||||
facebookUrl text,
|
||||
twitterUrl text,
|
||||
threadsUrl text,
|
||||
logoUrl text not null,
|
||||
lean text not null
|
||||
)
|
||||
`;
|
||||
|
||||
const createGoLinks = await sql`
|
||||
create table if not exists go_links (
|
||||
uuid text primary key,
|
||||
title text,
|
||||
slug text unique not null,
|
||||
forwardUrl text not null,
|
||||
created_at timestamptz default current_timestamp
|
||||
)
|
||||
`;
|
||||
|
||||
const createUserAiChatHistory = await sql`
|
||||
CREATE TABLE IF NOT EXISTS chat_history (
|
||||
id SERIAL PRIMARY KEY,
|
||||
|
@ -61,6 +36,30 @@ CREATE TABLE IF NOT EXISTS chat_history (
|
|||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
)`;
|
||||
|
||||
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
|
||||
)
|
||||
`
|
||||
|
||||
const hotNews = await sql`
|
||||
create table if not exists hot_news (
|
||||
uuid text primary key,
|
||||
title text not null,
|
||||
news_org text not null,
|
||||
link text not null,
|
||||
related_uuid text not null,
|
||||
created_at timestamptz default current_timestamp
|
||||
)
|
||||
`
|
||||
|
||||
|
||||
console.log("Creation Complete");
|
||||
|
||||
await sql.end();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue