-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.js
36 lines (34 loc) · 997 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
var migrations = require('./dynamodb/migrations'),
tableOpt = {
prefix: "",
suffix: ""
},
dynamo, dir;
var manager = {
init: function (dynamodb, migrationDir) {
dynamo = dynamodb;
dir = migrationDir;
},
create: function (migrationName) {
return migrations.create(migrationName, {
dir: dir
});
},
execute: function (migrationName, tableOptions) {
return migrations.execute(dynamo, {
dir: dir,
migrationName: migrationName,
tablePrefix: tableOptions.prefix || tableOpt.prefix,
tableSuffix: tableOptions.suffix || tableOpt.suffix
});
},
executeAll: function (tableOptions) {
return migrations.executeAll(dynamo, {
dir: dir,
tablePrefix: tableOptions.prefix || tableOpt.prefix,
tableSuffix: tableOptions.suffix || tableOpt.suffix
});
}
};
module.exports = manager;