Skip to content

Commit

Permalink
fix(generators): Fix migrate:make script in generated app
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed May 29, 2024
1 parent 188278e commit e27cb09
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/generators/src/connection/templates/knex.tpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,15 @@ export const generate = (ctx: ConnectionGeneratorContext) =>
)
.then(renderSource(knexfile, toFile('knexfile')))
.then(
mergeJSON<ConnectionGeneratorContext>(
(ctx) => ({
mergeJSON<ConnectionGeneratorContext>((ctx) => {
return {
scripts: {
migrate: 'knex migrate:latest',
'migrate:make': 'knex migrate:make' + ctx.language === 'js' ? ' -x mjs' : '',
'migrate:make': 'knex migrate:make' + (ctx.language === 'js' ? ' -x mjs' : ''),
test: 'cross-env NODE_ENV=test npm run migrate && npm run mocha'
}
}),
toFile('package.json')
)
}
}, toFile('package.json'))
)
.then(injectSource(importTemplate, before('import { services } from'), toAppFile))
.then(injectSource(configureTemplate, before('app.configure(services)'), toAppFile))
Expand Down

0 comments on commit e27cb09

Please sign in to comment.