serverless-dynamodb-local
Advanced tools
Comparing version 0.2.8 to 0.2.9
29
index.js
@@ -55,3 +55,12 @@ 'use strict'; | ||
description: 'Stage that dynamodb should be remotely executed' | ||
}] | ||
}, { | ||
option: 'table_prefix', | ||
shortcut: 'p', | ||
description: 'Table name prefix' | ||
}, { | ||
option: 'table_suffix', | ||
shortcut: 'x', | ||
description: 'Table name suffix' | ||
} | ||
] | ||
}); | ||
@@ -71,2 +80,10 @@ S.addAction(this.executeAll.bind(this), { | ||
description: 'Stage that dynamodb should be remotely executed' | ||
}, { | ||
option: 'table_prefix', | ||
shortcut: 'p', | ||
description: 'Table name prefix' | ||
}, { | ||
option: 'table_suffix', | ||
shortcut: 'x', | ||
description: 'Table name suffix' | ||
}] | ||
@@ -154,3 +171,3 @@ }); | ||
tableOptions() { | ||
tableOptions(table_prefix, table_suffix) { | ||
let config = S.getProject().custom.dynamodb, | ||
@@ -160,4 +177,4 @@ migration = config && config.migration || {}, | ||
path = rootPath + '/' + (migration.dir || 'dynamodb'), | ||
suffix = migration.table_suffix || '', | ||
prefix = migration.table_prefix || ''; | ||
suffix = table_suffix || migration.table_suffix || '', | ||
prefix = table_prefix || migration.table_prefix || ''; | ||
@@ -196,3 +213,3 @@ return { | ||
let dynamodb = self.dynamodbOptions(options.stage, options.region), | ||
tableOptions = self.tableOptions(); | ||
tableOptions = self.tableOptions(options.table_prefix, options.table_suffix); | ||
dynamodbMigrations.init(dynamodb, tableOptions.path); | ||
@@ -208,3 +225,3 @@ dynamodbMigrations.execute(options.name, tableOptions).then(resolve, reject); | ||
let dynamodb = self.dynamodbOptions(options.stage, options.region), | ||
tableOptions = self.tableOptions(); | ||
tableOptions = self.tableOptions(options.table_prefix, options.table_suffix); | ||
dynamodbMigrations.init(dynamodb, tableOptions.path); | ||
@@ -211,0 +228,0 @@ dynamodbMigrations.executeAll(tableOptions).then(resolve, reject); |
{ | ||
"name": "serverless-dynamodb-local", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=4.0" |
23790
245