feat: implement go_links table and update database connection handling

This commit is contained in:
yuanhau 2025-05-10 06:55:28 +08:00
parent 4aab557523
commit 1208866757
4 changed files with 44 additions and 14 deletions

View file

@ -1,4 +1,4 @@
import { sql } from "bun";
import sql from "~/server/components/postgres";
const createUsers = await sql`
create table if not exists users (
@ -42,6 +42,17 @@ create table if not exists newsProvidersZh (
)
`;
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 timestampz default current_timestamp
}
`
/*
const createAdminPosts = await sql`
create table if not exists adminPosts (
uuid text primary key,
@ -59,6 +70,6 @@ create table if not exists adminUsers (
created_at timestampz default current_timestamp,
lastlogged_at timestampz default current_timestamp,
)
`;
`;*/
console.log("Creation Complete");