mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-24 00:01:03 +08:00
Fix
This commit is contained in:
parent
8032c3faae
commit
feb679c3ef
@ -1,6 +1,8 @@
|
|||||||
import sql from "~/server/components/postgres";
|
import sql from "~/server/components/postgres";
|
||||||
|
const createSources = await sql``;
|
||||||
|
|
||||||
const createUsers = await sql`
|
export default defineEventHandler(async (event) => {
|
||||||
|
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 timestamptz default current_timestamp,
|
created_at timestamptz default current_timestamp,
|
||||||
@ -12,7 +14,7 @@ const createUsers = await sql`
|
|||||||
);
|
);
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const usersList = await sql`
|
const usersList = await sql`
|
||||||
create table if not exists usertokens (
|
create table if not exists usertokens (
|
||||||
token text not null primary key,
|
token text not null primary key,
|
||||||
created_at timestamptz default current_timestamp,
|
created_at timestamptz default current_timestamp,
|
||||||
@ -23,7 +25,7 @@ const usersList = await sql`
|
|||||||
)
|
)
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const createUserAiChatHistory = await sql`
|
const createUserAiChatHistory = await sql`
|
||||||
CREATE TABLE IF NOT EXISTS chat_history (
|
CREATE TABLE IF NOT EXISTS chat_history (
|
||||||
id SERIAL PRIMARY KEY,
|
id SERIAL PRIMARY KEY,
|
||||||
uuid VARCHAR(255) NOT NULL,
|
uuid VARCHAR(255) NOT NULL,
|
||||||
@ -32,9 +34,6 @@ CREATE TABLE IF NOT EXISTS chat_history (
|
|||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
)`;
|
)`;
|
||||||
|
|
||||||
const createSources = await sql``;
|
|
||||||
|
|
||||||
export default defineEventHandler(async (event) => {
|
|
||||||
return {
|
return {
|
||||||
createUsers: createUsers,
|
createUsers: createUsers,
|
||||||
usersList: usersList,
|
usersList: usersList,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user