Skip to content

Commit

Permalink
Merge pull request #128 from nikolay-karadzhov/issue-127-fails-when-n…
Browse files Browse the repository at this point in the history
…o-migrations-available

add --if-exists flag to migrate command
  • Loading branch information
timonmasberg committed May 16, 2024
2 parents 5ecb076 + b1dc818 commit dece379
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41798,7 +41798,7 @@ function migrate(keepMigrationsFile) {
env: Object.assign(Object.assign({}, process.env), { npm_config_yes: String(true) })
});
yield (0, exec_1.exec)('npm install');
yield (0, exec_1.exec)('npx nx migrate --run-migrations=migrations.json --create-commits', [], {
yield (0, exec_1.exec)('npx nx migrate --run-migrations=migrations.json --if-exists --create-commits', [], {
env: Object.assign(Object.assign({}, process.env), { npm_config_yes: String(true), NX_MIGRATE_SKIP_INSTALL: String(true) })
});
// sometimes migrations change packages without installing them, so naivly install dependencies here again
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/nx-migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function migrate(keepMigrationsFile: boolean): Promise<void> {
})
await exec('npm install')
await exec(
'npx nx migrate --run-migrations=migrations.json --create-commits',
'npx nx migrate --run-migrations=migrations.json --if-exists --create-commits',
[],
{
env: {
Expand Down

0 comments on commit dece379

Please sign in to comment.