Skip to content

Commit 80224fc

Browse files
committed
Forcing actions shouldn't force migration to run
1 parent eaeeb60 commit 80224fc

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/currentRunner.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,17 @@ export function makeCurrentMigrationRunner(
7575
migrationsAreEquivalent =
7676
currentBodyMinified === previousBodyMinified;
7777

78-
// 4: if different
78+
// 3a: Run actions if the migrations are different OR if forced.
7979
if (forceActions || !migrationsAreEquivalent) {
8080
await executeActions(
8181
parsedSettings,
8282
shadow,
8383
parsedSettings.beforeCurrent,
8484
);
85+
}
8586

87+
// 4: if different
88+
if (!migrationsAreEquivalent) {
8689
// 4a: invert previous current; on success delete from graphile_migrate.current; on failure rollback and abort
8790
if (previousBody) {
8891
await reverseMigration(lockingPgClient, previousBody);
@@ -136,7 +139,7 @@ export function makeCurrentMigrationRunner(
136139
);
137140
const interval = process.hrtime(start);
138141
const duration = interval[0] * 1e3 + interval[1] * 1e-6;
139-
if (!migrationsAreEquivalent) {
142+
if (forceActions || !migrationsAreEquivalent) {
140143
await executeActions(
141144
parsedSettings,
142145
shadow,

0 commit comments

Comments
 (0)