mirror of
https://github.com/fosrl/pangolin.git
synced 2025-05-12 21:30:35 +01:00
17 lines
422 B
TypeScript
17 lines
422 B
TypeScript
import db from "@server/db";
|
|
import { hostMeta } from "@server/db/schemas";
|
|
import { v4 as uuidv4 } from "uuid";
|
|
|
|
export async function setHostMeta() {
|
|
const [existing] = await db.select().from(hostMeta).limit(1);
|
|
|
|
if (existing && existing.hostMetaId) {
|
|
return;
|
|
}
|
|
|
|
const id = uuidv4();
|
|
|
|
await db
|
|
.insert(hostMeta)
|
|
.values({ hostMetaId: id, createdAt: new Date().getTime() });
|
|
}
|