Skip to content

Commit ca95b99

Browse files
chore: fix db-clean script (#2542)
1 parent aab91ae commit ca95b99

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

platform/backend/src/standalone-scripts/clean-db-on-dev.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { pathToFileURL } from "node:url";
22
import { sql } from "drizzle-orm";
33
import config from "@/config";
4-
import db from "@/database";
4+
import db, { initializeDatabase } from "@/database";
55
import logger from "@/logging";
66

77
/**
@@ -80,7 +80,8 @@ export const clearDb = async (): Promise<void> => {
8080
* CLI entry point for clearing the database
8181
*/
8282
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
83-
clearDb()
83+
initializeDatabase()
84+
.then(() => clearDb())
8485
.then(() => {
8586
logger.info("\n✅ Done!");
8687
process.exit(0);

0 commit comments

Comments
 (0)