Skip to content

Commit

Permalink
fix: missing timestamp in created migrations filenames (#8802)
Browse files Browse the repository at this point in the history
  • Loading branch information
lebedev authored Mar 26, 2022
1 parent ee8c1ec commit ceee439
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 ceee439

Please sign in to comment.