UNPKG

rwsdk-tools

Version:

A collection of utility tools for working with the RWSDK (Redwood SDK)

30 lines (25 loc) 714 B
import { defineScript } from "rwsdk/worker"; import { db, setupDb } from "@/db"; import { env } from "cloudflare:workers"; export default defineScript(async () => { await setupDb(env); await db.$executeRawUnsafe(`\ DELETE FROM Application; DELETE FROM ApplicationStatus; DELETE FROM Contact; DELETE FROM Company; DELETE FROM Credential; DELETE FROM User; DELETE FROM sqlite_sequence; `); await db.applicationStatus.createMany({ data: [ { id: 1, status: "New" }, { id: 2, status: "Applied" }, { id: 3, status: "Interview" }, { id: 4, status: "Rejected" }, { id: 5, status: "Offer" }, ], }); console.log("🌱 Finished seeding"); });