mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Fix SQL errors.
This commit is contained in:
parent
d6fb71d460
commit
f5734e7e5d
2 changed files with 8 additions and 5 deletions
|
@ -3,7 +3,7 @@ import sql from "~/server/components/postgres";
|
||||||
const createUsers = await sql`
|
const createUsers = await sql`
|
||||||
create table if not exists users (
|
create table if not exists users (
|
||||||
uuid text primary key,
|
uuid text primary key,
|
||||||
created_at timestampz default current_timestamp,
|
created_at timestamptz default current_timestamp,
|
||||||
username text not null unique,
|
username text not null unique,
|
||||||
oauthProvider text not null,
|
oauthProvider text not null,
|
||||||
avatarUrl text not null,
|
avatarUrl text not null,
|
||||||
|
@ -43,13 +43,13 @@ create table if not exists newsProvidersZh (
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const createGoLinks = await sql`
|
const createGoLinks = await sql`
|
||||||
create table if not exists go_links {
|
create table if not exists go_links (
|
||||||
uuid text primary key,
|
uuid text primary key,
|
||||||
title text,
|
title text,
|
||||||
slug text unique not null,
|
slug text unique not null,
|
||||||
forwardUrl text not null,
|
forwardUrl text not null,
|
||||||
created_at timestampz default current_timestamp
|
created_at timestamptz default current_timestamp
|
||||||
}
|
)
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const createUserAiChatHistory = await sql`
|
const createUserAiChatHistory = await sql`
|
||||||
|
@ -62,3 +62,6 @@ CREATE TABLE IF NOT EXISTS chat_history (
|
||||||
)`;
|
)`;
|
||||||
|
|
||||||
console.log("Creation Complete");
|
console.log("Creation Complete");
|
||||||
|
|
||||||
|
await sql.end();
|
||||||
|
process.exit(0)
|
|
@ -1,5 +1,5 @@
|
||||||
import SQL from "postgres";
|
import SQL from "postgres";
|
||||||
|
|
||||||
const postgres = SQL(`${process.env.POSTGRES_URL || ""}}`);
|
const postgres = SQL(`${process.env.POSTGRES_URL || ""}`);
|
||||||
|
|
||||||
export default postgres;
|
export default postgres;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue