Skip to content

Commit

Permalink
fix: missing timestamp in created migrations filenames (typeorm#8802)
Browse files Browse the repository at this point in the history
  • Loading branch information
lebedev authored and M-TGH committed Mar 29, 2022
1 parent 512914e commit 19c2c4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/commands/MigrationCreateCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ export class MigrationCreateCommand implements yargs.CommandModule {
async handler(args: yargs.Arguments) {
try {
const timestamp = CommandUtils.getTimestamp(args.timestamp)
const fullPath = (args.path as string).startsWith("/")
const inputPath = (args.path as string).startsWith("/")
? (args.path as string)
: path.resolve(process.cwd(), args.path as string)
const filename = path.basename(fullPath)
const filename = path.basename(inputPath)
const fullPath =
path.dirname(inputPath) + "/" + timestamp + "-" + filename

const fileContent = args.outputJs
? MigrationCreateCommand.getJavascriptTemplate(
Expand Down

0 comments on commit 19c2c4a

Please sign in to comment.