Push Create database?
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run

This commit is contained in:
yuanhau 2025-06-12 13:33:29 +08:00
parent 61f56a8c0a
commit a720bdd582

View file

@ -35,7 +35,7 @@ export default defineEventHandler(async (event) => {
const createUserOtherData = await sql`
create table if not exists user_other_data (
user_id text primary key,
user text not null unique,
username text not null unique,
groq_api_key text,
starred_news JSON not null,
translate_provider text,
@ -51,11 +51,21 @@ export default defineEventHandler(async (event) => {
)
`;
const createArticlesArchive = await sql`
create table if not exists news_articles (
uuid text primary key,
article_id text primary key,
jsondata json not null,
archive_timestamp timestamp default CURRENT_TIMESTAMP,
)
`;
return {
createUsers: createUsers,
usersList: usersList,
createUserAiChatHistory: createUserAiChatHistory,
createSources: createSources,
createUserOtherData: createUserOtherData,
createArticlesArchive: createArticlesArchive,
};
});