Skip to content

Commit e5cb967

Browse files
ybelMekktommytroen
andcommitted
fix: skip database migration if not the leader
Co-authored-by: Tommy Trøen <[email protected]>
1 parent 841e8e4 commit e5cb967

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/database/database.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ func migrateDatabaseSchema(ctx context.Context, driver, dsn string, log logrus.F
130130
if !migrated {
131131
continue
132132
}
133+
log.Info("not leader, skipping database migration")
134+
return nil
133135
}
134136
return goose.Up(db, "migrations")
135137
}

0 commit comments

Comments
 (0)