Fix migration log message showing 'undefined' when no toMigrationInclusive is provided
This commit is contained in:
1 file changed
+5
-1
@@ -90,7 +90,11 @@ export interface RunMigrationsOptions {
|
||||
*/
|
||||
export const runMigrations = ({ toMigrationInclusive }: RunMigrationsOptions = {}) =>
|
||||
Effect.gen(function* () {
|
||||
yield* Effect.log(`Running migrations 1 through ${toMigrationInclusive}...`);
|
||||
yield* Effect.log(
|
||||
toMigrationInclusive !== undefined
|
||||
? `Running migrations 1 through ${toMigrationInclusive}...`
|
||||
: "Running migrations...",
|
||||
);
|
||||
const executedMigrations = yield* run({ loader: makeMigrationLoader(toMigrationInclusive) });
|
||||
yield* Effect.log("Migrations ran successfully");
|
||||
return executedMigrations;
|
||||
|
||||
Reference in new issue
Block a user