@@ -16,15 +16,11 @@ class ServerlessDynamodbLocal {
1616 commands : {
1717 migrate : {
1818 lifecycleEvents : [ 'migrateHandler' ] ,
19- options : {
20- stage : {
21- shortcut : 'm' ,
22- usage : 'Create DynamoDB tables from the current serverless configuration'
23- }
24- }
19+ usage : 'Creates local DynamoDB tables from the current Serverless configuration'
2520 } ,
2621 start : {
2722 lifecycleEvents : [ 'startHandler' ] ,
23+ usage : 'Starts local DynamoDB' ,
2824 options : {
2925 port : {
3026 shortcut : 'p' ,
@@ -61,9 +57,11 @@ class ServerlessDynamodbLocal {
6157 }
6258 } ,
6359 remove : {
64- lifecycleEvents : [ 'removeHandler' ]
60+ lifecycleEvents : [ 'removeHandler' ] ,
61+ usage : 'Removes local DynamoDB'
6562 } ,
6663 install : {
64+ usage : 'Installs local DynamoDB' ,
6765 lifecycleEvents : [ 'installHandler' ] ,
6866 options : {
6967 localPath : {
@@ -103,30 +101,15 @@ class ServerlessDynamodbLocal {
103101 } ;
104102 }
105103
106- tableOptions ( table_prefix , table_suffix ) {
107- let self = this ;
108- let config = self . service . custom . dynamodb ,
109- migration = config && config . migration || { } ,
110- suffix = table_suffix || migration . table_suffix || '' ,
111- prefix = table_prefix || migration . table_prefix || '' ;
112-
113- return {
114- suffix : suffix ,
115- prefix : prefix
116- } ;
117- }
118-
119104 migrateHandler ( ) {
120105 let self = this ;
121106
122107 return new BbPromise ( function ( resolve , reject ) {
123- let dynamodb = self . dynamodbOptions ( ) ,
124- tableOptions = self . tableOptions ( ) ;
108+ let dynamodb = self . dynamodbOptions ( ) ;
125109
126110 var tables = self . resourceTables ( ) ;
127111
128112 return BbPromise . each ( tables , function ( table ) {
129- table . TableName = self . formatTableName ( table , tableOptions ) ;
130113 return self . createTable ( dynamodb , table ) ;
131114 } ) . then ( resolve , reject ) ;
132115 } ) ;
@@ -191,9 +174,5 @@ class ServerlessDynamodbLocal {
191174 } ) ;
192175 } ) ;
193176 }
194-
195- formatTableName ( table , options ) {
196- return options . prefix + table . TableName + options . suffix ;
197- }
198177}
199- module . exports = ServerlessDynamodbLocal ;
178+ module . exports = ServerlessDynamodbLocal ;
0 commit comments