Skip to content

Commit 7a8956e

Browse files
committed
fix(migrator): pass migrationsPath option to umzug
1 parent fb2526c commit 7a8956e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/migrator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,25 @@ export class Migrator extends Umzug implements Generator {
3737
* @param options.attributeName - name of the table primaryKey attribute in DynamoDB
3838
*/
3939
constructor(options: MigratorOptions = {}) {
40-
let { dynamodb, tableName, attributeName } = options;
40+
let { dynamodb, tableName, attributeName, migrationsPath } = options;
4141

4242
dynamodb = dynamodb || new DocumentClient(pick(['region', 'accessKeyId', 'secretAccessKey'], options));
4343
tableName = tableName || 'migrations';
4444
attributeName = attributeName || 'name';
45+
migrationsPath = migrationsPath || 'migrations';
4546

4647
super({
4748
storage: new DynamoDBStorage({ dynamodb, tableName, attributeName }),
4849
migrations: {
4950
params: [dynamodb],
51+
path: migrationsPath,
5052
},
5153
logging: logger.log
5254
});
5355

5456
const plop = nodePlop(path.join(__dirname, '../../.plop/plopfile.js'));
5557
this.generator = plop.getGenerator('migration');
56-
this.migrationsPath = options.migrationsPath || 'migrations';
58+
this.migrationsPath = migrationsPath;
5759
}
5860

5961
async generate(migrationName: string) {

0 commit comments

Comments
 (0)