feat : remove legacy feature
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
import { closeDb, getDb } from "@/db/client";
|
||||
import { templates } from "@/db/schema";
|
||||
import { builtInTemplates } from "@/lib/templates";
|
||||
|
||||
const db = getDb();
|
||||
|
||||
for (const template of builtInTemplates) {
|
||||
await db
|
||||
.insert(templates)
|
||||
.values({
|
||||
slug: template.slug,
|
||||
name: template.name,
|
||||
description: template.description,
|
||||
category: template.category,
|
||||
structure: template as unknown as Record<string, unknown>,
|
||||
builtIn: true,
|
||||
})
|
||||
.onConflictDoUpdate({
|
||||
target: templates.slug,
|
||||
set: {
|
||||
name: template.name,
|
||||
description: template.description,
|
||||
category: template.category,
|
||||
structure: template as unknown as Record<string, unknown>,
|
||||
builtIn: true,
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
await closeDb();
|
||||
Reference in New Issue
Block a user