Skip to content

Commit

Permalink
Fix broken db:seed script
Browse files Browse the repository at this point in the history
  • Loading branch information
flenter committed Jun 5, 2024
1 parent dbc822f commit d28dd12
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
File renamed without changes.
File renamed without changes.
15 changes: 5 additions & 10 deletions api/test-content/seed.ts → api/scripts/seed.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { createClient } from "@libsql/client";
import { drizzle } from "drizzle-orm/libsql";
import fs from "node:fs/promises";
import {
githubIssues,
mizuLogs,
newGithubIssueSchema,
newMizuLogSchema,
} from "../src/db/schema";
import { createClient } from "@libsql/client";
import { config } from "dotenv";
import { drizzle } from "drizzle-orm/libsql";
import { githubIssues, mizuLogs } from "../src/db/schema";
config({ path: ".dev.vars" });

const dbUrl = process.env.DATABASE_URL;
Expand All @@ -20,8 +15,8 @@ if (!dbUrl) {
const db = drizzle(createClient({ url: dbUrl }));

(async () => {
const issuesFile = await fs.readFile("./scripts/github_issues.json", "utf8");
const logsFile = await fs.readFile("./scripts/mizu_logs.json", "utf8");
const issuesFile = await fs.readFile("./seed/seed-assets/github_issues.json", "utf8");
const logsFile = await fs.readFile("./seed/seed-assets/mizu_logs.json", "utf8");
const issues = JSON.parse(issuesFile);
const logs = JSON.parse(logsFile);

Expand Down

0 comments on commit d28dd12

Please sign in to comment.