copy-dynamodb-table
Advanced tools
Comparing version 2.0.5 to 2.0.6
10
index.js
@@ -24,2 +24,3 @@ 'use strict' | ||
dynamodb: values.source.dynamodb || new AWS.DynamoDB(values.source.config || values.config), | ||
active: values.source.active | ||
}, | ||
@@ -30,2 +31,3 @@ destination: { | ||
dynamodb: values.source.dynamodb || new AWS.DynamoDB(values.destination.config || values.config), | ||
active:values.destination.active, | ||
createTableStr : 'Creating Destination Table ' | ||
@@ -41,2 +43,6 @@ }, | ||
if(options.source.active && options.destination.active){ // both tables are active | ||
return startCopying(options,fn) | ||
} | ||
if(options.create){ // create table if not exist | ||
@@ -47,2 +53,3 @@ return options.source.dynamodb.describeTable({TableName : options.source.tableName},function(err,data){ | ||
} | ||
options.source.active = true | ||
data.Table.TableName = options.destination.tableName | ||
@@ -116,2 +123,3 @@ options.destination.dynamodb.createTable(clearTableSchema(data.Table),function(err){ | ||
} | ||
options.source.active = true | ||
options.destination.dynamodb.describeTable({TableName : options.destination.tableName},function(err,destData){ | ||
@@ -124,2 +132,3 @@ if(err){ | ||
} | ||
options.destination.active = true | ||
fn(null) | ||
@@ -146,2 +155,3 @@ }) | ||
options.create = false | ||
options.destination.active = true | ||
startCopying(options,fn) | ||
@@ -148,0 +158,0 @@ }) |
{ | ||
"name": "copy-dynamodb-table", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "Copy Dynamodb table to another in the same or different zone , It is 100% safe , and speed depends on your destination table user defined write provisioned throughput", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -17,3 +17,3 @@ Safe Copy Dynamodb Table | ||
```js | ||
const copy = require('copy-dynamodb-table').copy | ||
var copy = require('copy-dynamodb-table').copy | ||
@@ -20,0 +20,0 @@ copy({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14609
313