Skip to content

Commit

Permalink
fix: make migration filenames windows compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
cmgriffing committed Jan 25, 2024
1 parent 8c406f5 commit 43ae152
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/migration-new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ export async function down(db: Kysely<any>): Promise<void> {
`;

fs.writeFileSync(
path.resolve(__dirname, "../src/data/migrations", `${date}-${name}.ts`),
path.resolve(
__dirname,
"../src/data/migrations",
`${date.replaceAll(":", "")}-${name}.ts`
),
template
);

Expand All @@ -60,5 +64,5 @@ fs.appendFileSync(
`\nexport * as migration${date
.replaceAll("-", "")
.replaceAll(":", "")
.replaceAll(".", "")} from "./${date}-${name}.ts"`
.replaceAll(".", "")} from "./${date.replaceAll(":", "")}-${name}.ts"`
);

0 comments on commit 43ae152

Please sign in to comment.