@ftschopp/dynatable-migrations 1.1.0 ā 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +102 -134
- package/USAGE.md +199 -60
- package/dist/cli.js +7 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/down.d.ts +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +5 -20
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +2 -17
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/up.d.ts +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +5 -20
- package/dist/commands/up.js.map +1 -1
- package/dist/core/client.d.ts +7 -0
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/client.js +25 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/loader.d.ts +8 -0
- package/dist/core/loader.d.ts.map +1 -1
- package/dist/core/loader.js +76 -43
- package/dist/core/loader.js.map +1 -1
- package/dist/core/runner.d.ts +6 -2
- package/dist/core/runner.d.ts.map +1 -1
- package/dist/core/runner.js +124 -67
- package/dist/core/runner.js.map +1 -1
- package/dist/core/tracker.d.ts +20 -1
- package/dist/core/tracker.d.ts.map +1 -1
- package/dist/core/tracker.js +273 -83
- package/dist/core/tracker.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +10 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -3
- package/src/cli.ts +8 -3
- package/src/commands/down.ts +6 -22
- package/src/commands/status.ts +2 -19
- package/src/commands/up.ts +9 -22
- package/src/core/client.ts +24 -0
- package/src/core/loader.ts +88 -46
- package/src/core/runner.ts +151 -78
- package/src/core/tracker.ts +306 -94
- package/src/index.ts +2 -1
- package/src/types/index.ts +13 -1
package/USAGE.md
CHANGED
|
@@ -59,7 +59,7 @@ module.exports = {
|
|
|
59
59
|
npx dynatable-migrate create add_user_email
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Creates: `migrations/
|
|
62
|
+
Creates: `migrations/0.1.0_add_user_email.ts`
|
|
63
63
|
|
|
64
64
|
### 5. Edit the migration
|
|
65
65
|
|
|
@@ -67,14 +67,16 @@ Creates: `migrations/v0001_add_user_email.ts`
|
|
|
67
67
|
import { Migration } from '@ftschopp/dynatable-migrations';
|
|
68
68
|
|
|
69
69
|
export const migration: Migration = {
|
|
70
|
-
version: '
|
|
70
|
+
version: '0.1.0',
|
|
71
71
|
name: 'add_user_email',
|
|
72
72
|
|
|
73
|
-
async up(
|
|
73
|
+
async up(context) {
|
|
74
|
+
const { client, tableName, dynamodb } = context;
|
|
74
75
|
// Your migration code here
|
|
75
76
|
},
|
|
76
77
|
|
|
77
|
-
async down(
|
|
78
|
+
async down(context) {
|
|
79
|
+
const { client, tableName, dynamodb } = context;
|
|
78
80
|
// Rollback code here
|
|
79
81
|
},
|
|
80
82
|
};
|
|
@@ -86,6 +88,9 @@ export const migration: Migration = {
|
|
|
86
88
|
# Check status first
|
|
87
89
|
npx dynatable-migrate status
|
|
88
90
|
|
|
91
|
+
# Preview changes (dry run)
|
|
92
|
+
npx dynatable-migrate up --dry-run
|
|
93
|
+
|
|
89
94
|
# Apply all pending migrations
|
|
90
95
|
npx dynatable-migrate up
|
|
91
96
|
|
|
@@ -99,10 +104,11 @@ npx dynatable-migrate down
|
|
|
99
104
|
|
|
100
105
|
```typescript
|
|
101
106
|
export const migration: Migration = {
|
|
102
|
-
version: '
|
|
107
|
+
version: '0.1.0',
|
|
103
108
|
name: 'add_user_bio',
|
|
104
109
|
|
|
105
|
-
async up(
|
|
110
|
+
async up(context) {
|
|
111
|
+
const { client, tableName, dynamodb } = context;
|
|
106
112
|
const { ScanCommand, UpdateCommand } = dynamodb;
|
|
107
113
|
|
|
108
114
|
// Find all users
|
|
@@ -127,8 +133,8 @@ export const migration: Migration = {
|
|
|
127
133
|
}
|
|
128
134
|
},
|
|
129
135
|
|
|
130
|
-
async down(
|
|
131
|
-
|
|
136
|
+
async down(context) {
|
|
137
|
+
const { client, tableName, dynamodb } = context;
|
|
132
138
|
const { ScanCommand, UpdateCommand } = dynamodb;
|
|
133
139
|
|
|
134
140
|
const result = await client.send(
|
|
@@ -156,10 +162,11 @@ export const migration: Migration = {
|
|
|
156
162
|
|
|
157
163
|
```typescript
|
|
158
164
|
export const migration: Migration = {
|
|
159
|
-
version: '
|
|
165
|
+
version: '0.2.0',
|
|
160
166
|
name: 'normalize_usernames',
|
|
161
167
|
|
|
162
|
-
async up(
|
|
168
|
+
async up(context) {
|
|
169
|
+
const { client, tableName, dynamodb } = context;
|
|
163
170
|
const { ScanCommand, UpdateCommand } = dynamodb;
|
|
164
171
|
|
|
165
172
|
const result = await client.send(
|
|
@@ -186,8 +193,8 @@ export const migration: Migration = {
|
|
|
186
193
|
}
|
|
187
194
|
},
|
|
188
195
|
|
|
189
|
-
async down(
|
|
190
|
-
console.log('Cannot revert username normalization');
|
|
196
|
+
async down(context) {
|
|
197
|
+
console.log('Cannot revert username normalization - data transformation is one-way');
|
|
191
198
|
},
|
|
192
199
|
};
|
|
193
200
|
```
|
|
@@ -196,10 +203,11 @@ export const migration: Migration = {
|
|
|
196
203
|
|
|
197
204
|
```typescript
|
|
198
205
|
export const migration: Migration = {
|
|
199
|
-
version: '
|
|
206
|
+
version: '0.3.0',
|
|
200
207
|
name: 'change_photo_sort_key',
|
|
201
208
|
|
|
202
|
-
async up(
|
|
209
|
+
async up(context) {
|
|
210
|
+
const { client, tableName, dynamodb } = context;
|
|
203
211
|
const { ScanCommand, TransactWriteCommand } = dynamodb;
|
|
204
212
|
|
|
205
213
|
const result = await client.send(
|
|
@@ -249,17 +257,17 @@ export const migration: Migration = {
|
|
|
249
257
|
}
|
|
250
258
|
},
|
|
251
259
|
|
|
252
|
-
async down(
|
|
253
|
-
// Similar logic but reverse
|
|
260
|
+
async down(context) {
|
|
261
|
+
// Similar logic but reverse the SK transformation
|
|
254
262
|
},
|
|
255
263
|
};
|
|
256
264
|
```
|
|
257
265
|
|
|
258
|
-
### Pattern 4: Add New Entity Type (
|
|
266
|
+
### Pattern 4: Add New Entity Type (Schema Documentation Only)
|
|
259
267
|
|
|
260
268
|
```typescript
|
|
261
269
|
export const migration: Migration = {
|
|
262
|
-
version: '
|
|
270
|
+
version: '0.4.0',
|
|
263
271
|
name: 'add_notification_entity',
|
|
264
272
|
|
|
265
273
|
schema: {
|
|
@@ -269,31 +277,32 @@ export const migration: Migration = {
|
|
|
269
277
|
SK: 'NOTIFICATION#${notificationId}',
|
|
270
278
|
},
|
|
271
279
|
attributes: {
|
|
272
|
-
userId: { type:
|
|
273
|
-
notificationId: { type:
|
|
274
|
-
message: { type:
|
|
275
|
-
read: { type:
|
|
280
|
+
userId: { type: 'string', required: true },
|
|
281
|
+
notificationId: { type: 'string', generate: 'ulid' },
|
|
282
|
+
message: { type: 'string', required: true },
|
|
283
|
+
read: { type: 'boolean', default: false },
|
|
276
284
|
},
|
|
277
285
|
},
|
|
278
286
|
},
|
|
279
287
|
|
|
280
|
-
async up(
|
|
288
|
+
async up(context) {
|
|
281
289
|
// In Single Table Design, adding a new entity type
|
|
282
290
|
// doesn't require data migration, just schema documentation
|
|
283
|
-
await tracker.recordSchemaChange({
|
|
291
|
+
await context.tracker.recordSchemaChange({
|
|
284
292
|
entity: 'Notification',
|
|
285
293
|
changes: {
|
|
286
294
|
added: ['userId', 'notificationId', 'message', 'read'],
|
|
287
295
|
},
|
|
288
296
|
});
|
|
289
297
|
|
|
290
|
-
console.log('
|
|
298
|
+
console.log('Notification entity added to schema');
|
|
291
299
|
},
|
|
292
300
|
|
|
293
|
-
async down(
|
|
294
|
-
|
|
301
|
+
async down(context) {
|
|
302
|
+
const { client, tableName, dynamodb } = context;
|
|
295
303
|
const { ScanCommand, DeleteCommand } = dynamodb;
|
|
296
304
|
|
|
305
|
+
// Delete all notifications if rolling back
|
|
297
306
|
const result = await client.send(
|
|
298
307
|
new ScanCommand({
|
|
299
308
|
TableName: tableName,
|
|
@@ -314,6 +323,94 @@ export const migration: Migration = {
|
|
|
314
323
|
};
|
|
315
324
|
```
|
|
316
325
|
|
|
326
|
+
### Pattern 5: Batch Processing with Pagination
|
|
327
|
+
|
|
328
|
+
```typescript
|
|
329
|
+
export const migration: Migration = {
|
|
330
|
+
version: '0.5.0',
|
|
331
|
+
name: 'add_timestamps_to_all_items',
|
|
332
|
+
|
|
333
|
+
async up(context) {
|
|
334
|
+
const { client, tableName, dynamodb } = context;
|
|
335
|
+
const { ScanCommand, UpdateCommand } = dynamodb;
|
|
336
|
+
|
|
337
|
+
let lastEvaluatedKey: Record<string, any> | undefined;
|
|
338
|
+
let totalProcessed = 0;
|
|
339
|
+
|
|
340
|
+
do {
|
|
341
|
+
const result = await client.send(
|
|
342
|
+
new ScanCommand({
|
|
343
|
+
TableName: tableName,
|
|
344
|
+
ExclusiveStartKey: lastEvaluatedKey,
|
|
345
|
+
Limit: 100, // Process in batches
|
|
346
|
+
})
|
|
347
|
+
);
|
|
348
|
+
|
|
349
|
+
for (const item of result.Items || []) {
|
|
350
|
+
// Skip schema tracking items
|
|
351
|
+
if (item.PK?.startsWith('_SCHEMA#')) continue;
|
|
352
|
+
|
|
353
|
+
await client.send(
|
|
354
|
+
new UpdateCommand({
|
|
355
|
+
TableName: tableName,
|
|
356
|
+
Key: { PK: item.PK, SK: item.SK },
|
|
357
|
+
UpdateExpression: 'SET #createdAt = if_not_exists(#createdAt, :now), #updatedAt = :now',
|
|
358
|
+
ExpressionAttributeNames: {
|
|
359
|
+
'#createdAt': 'createdAt',
|
|
360
|
+
'#updatedAt': 'updatedAt',
|
|
361
|
+
},
|
|
362
|
+
ExpressionAttributeValues: {
|
|
363
|
+
':now': new Date().toISOString(),
|
|
364
|
+
},
|
|
365
|
+
})
|
|
366
|
+
);
|
|
367
|
+
totalProcessed++;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
lastEvaluatedKey = result.LastEvaluatedKey;
|
|
371
|
+
console.log(`Processed ${totalProcessed} items...`);
|
|
372
|
+
} while (lastEvaluatedKey);
|
|
373
|
+
|
|
374
|
+
console.log(`Migration complete. Total items updated: ${totalProcessed}`);
|
|
375
|
+
},
|
|
376
|
+
|
|
377
|
+
async down(context) {
|
|
378
|
+
// Removing timestamps is usually not needed, but here's how:
|
|
379
|
+
const { client, tableName, dynamodb } = context;
|
|
380
|
+
const { ScanCommand, UpdateCommand } = dynamodb;
|
|
381
|
+
|
|
382
|
+
let lastEvaluatedKey: Record<string, any> | undefined;
|
|
383
|
+
|
|
384
|
+
do {
|
|
385
|
+
const result = await client.send(
|
|
386
|
+
new ScanCommand({
|
|
387
|
+
TableName: tableName,
|
|
388
|
+
ExclusiveStartKey: lastEvaluatedKey,
|
|
389
|
+
})
|
|
390
|
+
);
|
|
391
|
+
|
|
392
|
+
for (const item of result.Items || []) {
|
|
393
|
+
if (item.PK?.startsWith('_SCHEMA#')) continue;
|
|
394
|
+
|
|
395
|
+
await client.send(
|
|
396
|
+
new UpdateCommand({
|
|
397
|
+
TableName: tableName,
|
|
398
|
+
Key: { PK: item.PK, SK: item.SK },
|
|
399
|
+
UpdateExpression: 'REMOVE #createdAt, #updatedAt',
|
|
400
|
+
ExpressionAttributeNames: {
|
|
401
|
+
'#createdAt': 'createdAt',
|
|
402
|
+
'#updatedAt': 'updatedAt',
|
|
403
|
+
},
|
|
404
|
+
})
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
lastEvaluatedKey = result.LastEvaluatedKey;
|
|
409
|
+
} while (lastEvaluatedKey);
|
|
410
|
+
},
|
|
411
|
+
};
|
|
412
|
+
```
|
|
413
|
+
|
|
317
414
|
## CLI Commands Reference
|
|
318
415
|
|
|
319
416
|
### `dynatable-migrate init`
|
|
@@ -327,11 +424,23 @@ Create a new migration file.
|
|
|
327
424
|
**Options:**
|
|
328
425
|
|
|
329
426
|
- `-c, --config <path>` - Custom config file path
|
|
427
|
+
- `-t, --type <type>` - Version bump type: `major`, `minor`, or `patch` (default: patch)
|
|
428
|
+
- `-e, --explicit <version>` - Explicit semver version (e.g., 2.0.0)
|
|
330
429
|
|
|
331
|
-
**
|
|
430
|
+
**Examples:**
|
|
332
431
|
|
|
333
432
|
```bash
|
|
334
|
-
|
|
433
|
+
# Create with patch bump (default): 0.1.0 -> 0.1.1
|
|
434
|
+
dynatable-migrate create fix_typo
|
|
435
|
+
|
|
436
|
+
# Create with minor bump: 0.1.1 -> 0.2.0
|
|
437
|
+
dynatable-migrate create add_notifications --type minor
|
|
438
|
+
|
|
439
|
+
# Create with major bump: 0.2.0 -> 1.0.0
|
|
440
|
+
dynatable-migrate create breaking_change --type major
|
|
441
|
+
|
|
442
|
+
# Create with explicit version
|
|
443
|
+
dynatable-migrate create hotfix --explicit 0.1.2
|
|
335
444
|
```
|
|
336
445
|
|
|
337
446
|
### `dynatable-migrate up`
|
|
@@ -342,6 +451,7 @@ Run all pending migrations.
|
|
|
342
451
|
|
|
343
452
|
- `-c, --config <path>` - Custom config file path
|
|
344
453
|
- `-l, --limit <number>` - Limit migrations to run
|
|
454
|
+
- `-d, --dry-run` - Preview changes without applying them
|
|
345
455
|
|
|
346
456
|
**Examples:**
|
|
347
457
|
|
|
@@ -349,6 +459,9 @@ Run all pending migrations.
|
|
|
349
459
|
# Run all pending
|
|
350
460
|
dynatable-migrate up
|
|
351
461
|
|
|
462
|
+
# Preview what would run
|
|
463
|
+
dynatable-migrate up --dry-run
|
|
464
|
+
|
|
352
465
|
# Run only next migration
|
|
353
466
|
dynatable-migrate up --limit 1
|
|
354
467
|
|
|
@@ -364,6 +477,7 @@ Rollback migrations.
|
|
|
364
477
|
|
|
365
478
|
- `-c, --config <path>` - Custom config file path
|
|
366
479
|
- `-s, --steps <number>` - Number of migrations to rollback (default: 1)
|
|
480
|
+
- `-d, --dry-run` - Preview changes without applying them
|
|
367
481
|
|
|
368
482
|
**Examples:**
|
|
369
483
|
|
|
@@ -371,6 +485,9 @@ Rollback migrations.
|
|
|
371
485
|
# Rollback last migration
|
|
372
486
|
dynatable-migrate down
|
|
373
487
|
|
|
488
|
+
# Preview rollback
|
|
489
|
+
dynatable-migrate down --dry-run
|
|
490
|
+
|
|
374
491
|
# Rollback last 3 migrations
|
|
375
492
|
dynatable-migrate down --steps 3
|
|
376
493
|
```
|
|
@@ -390,16 +507,16 @@ dynatable-migrate status
|
|
|
390
507
|
```
|
|
391
508
|
š Migration Status
|
|
392
509
|
|
|
393
|
-
Table:
|
|
394
|
-
Current version:
|
|
510
|
+
Table: MyApp
|
|
511
|
+
Current version: 0.2.0
|
|
395
512
|
Migrations directory: ./migrations
|
|
396
513
|
|
|
397
514
|
ā
Applied (2):
|
|
398
|
-
|
|
399
|
-
|
|
515
|
+
0.1.0 - add_user_email (2025-03-29 10:00:00)
|
|
516
|
+
0.2.0 - normalize_usernames (2025-03-29 11:00:00)
|
|
400
517
|
|
|
401
518
|
ā³ Pending (1):
|
|
402
|
-
|
|
519
|
+
0.3.0 - change_photo_sort_key
|
|
403
520
|
|
|
404
521
|
Total: 3 migration(s)
|
|
405
522
|
```
|
|
@@ -443,41 +560,53 @@ Use DynamoDB Local to test migrations before running on production:
|
|
|
443
560
|
docker run -p 8000:8000 amazon/dynamodb-local
|
|
444
561
|
```
|
|
445
562
|
|
|
446
|
-
### 3.
|
|
563
|
+
### 3. Use Dry Run Mode
|
|
564
|
+
|
|
565
|
+
Always preview changes before applying them:
|
|
566
|
+
|
|
567
|
+
```bash
|
|
568
|
+
dynatable-migrate up --dry-run
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
### 4. Backup Before Running
|
|
447
572
|
|
|
448
573
|
Enable point-in-time recovery on your production tables.
|
|
449
574
|
|
|
450
|
-
###
|
|
575
|
+
### 5. Keep Migrations Focused
|
|
451
576
|
|
|
452
577
|
One migration = one change. Don't combine multiple unrelated changes.
|
|
453
578
|
|
|
454
|
-
###
|
|
579
|
+
### 6. Never Modify Applied Migrations
|
|
455
580
|
|
|
456
581
|
Once a migration is applied, don't change it. Create a new migration instead.
|
|
457
582
|
|
|
458
|
-
###
|
|
583
|
+
### 7. Use Transactions for Atomic Operations
|
|
459
584
|
|
|
460
585
|
For multi-step changes that must succeed or fail together:
|
|
461
586
|
|
|
462
587
|
```typescript
|
|
463
|
-
await client.send(
|
|
464
|
-
|
|
465
|
-
{ Put: { ... } },
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
]
|
|
469
|
-
}));
|
|
588
|
+
await client.send(
|
|
589
|
+
new context.dynamodb.TransactWriteCommand({
|
|
590
|
+
TransactItems: [{ Put: { ... } }, { Update: { ... } }, { Delete: { ... } }],
|
|
591
|
+
})
|
|
592
|
+
);
|
|
470
593
|
```
|
|
471
594
|
|
|
472
|
-
###
|
|
595
|
+
### 8. Handle Large Datasets Carefully
|
|
473
596
|
|
|
474
597
|
For tables with many items:
|
|
475
598
|
|
|
476
|
-
- Process in batches
|
|
599
|
+
- Process in batches with pagination
|
|
477
600
|
- Add delays between batches to avoid throttling
|
|
478
601
|
- Consider using DynamoDB Streams for background processing
|
|
479
602
|
|
|
480
|
-
###
|
|
603
|
+
### 9. Use Semantic Versioning
|
|
604
|
+
|
|
605
|
+
- **Major** (1.0.0): Breaking schema changes
|
|
606
|
+
- **Minor** (0.1.0): New features, new entity types
|
|
607
|
+
- **Patch** (0.0.1): Bug fixes, small adjustments
|
|
608
|
+
|
|
609
|
+
### 10. Document Your Changes
|
|
481
610
|
|
|
482
611
|
Use the `schema` field to document what changed:
|
|
483
612
|
|
|
@@ -509,7 +638,7 @@ If a migration fails partway through:
|
|
|
509
638
|
|
|
510
639
|
Make sure:
|
|
511
640
|
|
|
512
|
-
- Migration file follows naming convention: `
|
|
641
|
+
- Migration file follows naming convention: `0.1.0_name.ts`
|
|
513
642
|
- File is in the `migrationsDir` specified in config
|
|
514
643
|
- File exports a `migration` object
|
|
515
644
|
|
|
@@ -524,34 +653,44 @@ Ensure your AWS credentials have permissions for:
|
|
|
524
653
|
- `dynamodb:UpdateItem`
|
|
525
654
|
- `dynamodb:DeleteItem`
|
|
526
655
|
|
|
656
|
+
### Lock Acquisition Failed
|
|
657
|
+
|
|
658
|
+
If you see "Could not acquire migration lock":
|
|
659
|
+
|
|
660
|
+
- Another migration may be running
|
|
661
|
+
- Wait a few minutes (lock expires after 5 minutes)
|
|
662
|
+
- Check if any stuck processes are running
|
|
663
|
+
|
|
527
664
|
## Advanced: Programmatic Usage
|
|
528
665
|
|
|
529
666
|
You can also use the migration runner in your code:
|
|
530
667
|
|
|
531
668
|
```typescript
|
|
532
|
-
import {
|
|
533
|
-
|
|
534
|
-
|
|
669
|
+
import {
|
|
670
|
+
MigrationRunner,
|
|
671
|
+
loadConfig,
|
|
672
|
+
createDynamoDBClient,
|
|
673
|
+
} from '@ftschopp/dynatable-migrations';
|
|
535
674
|
|
|
536
675
|
async function runMigrations() {
|
|
537
676
|
const config = await loadConfig();
|
|
538
|
-
|
|
539
|
-
const ddbClient = new DynamoDBClient({
|
|
540
|
-
region: config.client.region,
|
|
541
|
-
endpoint: config.client.endpoint,
|
|
542
|
-
});
|
|
543
|
-
|
|
544
|
-
const client = DynamoDBDocumentClient.from(ddbClient);
|
|
677
|
+
const client = createDynamoDBClient(config);
|
|
545
678
|
const runner = new MigrationRunner(client, config);
|
|
546
679
|
|
|
547
680
|
// Get status
|
|
548
681
|
const status = await runner.status();
|
|
549
682
|
console.log('Migration status:', status);
|
|
550
683
|
|
|
684
|
+
// Preview migrations (dry run)
|
|
685
|
+
await runner.up({ dryRun: true });
|
|
686
|
+
|
|
551
687
|
// Run migrations
|
|
552
688
|
await runner.up();
|
|
553
689
|
|
|
690
|
+
// Run with limit
|
|
691
|
+
await runner.up({ limit: 1 });
|
|
692
|
+
|
|
554
693
|
// Rollback
|
|
555
|
-
await runner.down(1);
|
|
694
|
+
await runner.down({ steps: 1 });
|
|
556
695
|
}
|
|
557
696
|
```
|
package/dist/cli.js
CHANGED
|
@@ -8,11 +8,13 @@ const up_1 = require("./commands/up");
|
|
|
8
8
|
const down_1 = require("./commands/down");
|
|
9
9
|
const status_1 = require("./commands/status");
|
|
10
10
|
const init_1 = require("./commands/init");
|
|
11
|
+
// Read version from package.json
|
|
12
|
+
const packageJson = require('../package.json');
|
|
11
13
|
const program = new commander_1.Command();
|
|
12
14
|
program
|
|
13
15
|
.name('dynatable-migrate')
|
|
14
16
|
.description('DynamoDB migration tool for single table design')
|
|
15
|
-
.version(
|
|
17
|
+
.version(packageJson.version);
|
|
16
18
|
// Init command
|
|
17
19
|
program
|
|
18
20
|
.command('init')
|
|
@@ -57,11 +59,12 @@ program
|
|
|
57
59
|
.description('Run pending migrations')
|
|
58
60
|
.option('-c, --config <path>', 'Path to config file')
|
|
59
61
|
.option('-l, --limit <number>', 'Limit number of migrations to run')
|
|
62
|
+
.option('-d, --dry-run', 'Show what would be done without making changes')
|
|
60
63
|
.action(async (options) => {
|
|
61
64
|
try {
|
|
62
65
|
const config = await (0, config_1.loadConfig)(options.config);
|
|
63
66
|
const limit = options.limit ? parseInt(options.limit, 10) : undefined;
|
|
64
|
-
await (0, up_1.runMigrations)(config, limit);
|
|
67
|
+
await (0, up_1.runMigrations)(config, limit, options.dryRun);
|
|
65
68
|
}
|
|
66
69
|
catch (error) {
|
|
67
70
|
console.error(`Error: ${error.message}`);
|
|
@@ -74,11 +77,12 @@ program
|
|
|
74
77
|
.description('Rollback migrations')
|
|
75
78
|
.option('-c, --config <path>', 'Path to config file')
|
|
76
79
|
.option('-s, --steps <number>', 'Number of migrations to rollback', '1')
|
|
80
|
+
.option('-d, --dry-run', 'Show what would be done without making changes')
|
|
77
81
|
.action(async (options) => {
|
|
78
82
|
try {
|
|
79
83
|
const config = await (0, config_1.loadConfig)(options.config);
|
|
80
84
|
const steps = parseInt(options.steps, 10);
|
|
81
|
-
await (0, down_1.rollbackMigrations)(config, steps);
|
|
85
|
+
await (0, down_1.rollbackMigrations)(config, steps, options.dryRun);
|
|
82
86
|
}
|
|
83
87
|
catch (error) {
|
|
84
88
|
console.error(`Error: ${error.message}`);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA2C;AAC3C,8CAAoD;AACpD,sCAA8C;AAC9C,0CAAqD;AACrD,8CAA+C;AAC/C,0CAA8C;AAE9C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,mBAAmB,CAAC;KACzB,WAAW,CAAC,iDAAiD,CAAC;KAC9D,OAAO,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA2C;AAC3C,8CAAoD;AACpD,sCAA8C;AAC9C,0CAAqD;AACrD,8CAA+C;AAC/C,0CAA8C;AAE9C,iCAAiC;AACjC,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,mBAAmB,CAAC;KACzB,WAAW,CAAC,iDAAiD,CAAC;KAC9D,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAEhC,eAAe;AACf,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,0CAA0C,CAAC;KACvD,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,IAAI,CAAC;QACH,MAAM,IAAA,kBAAW,GAAE,CAAC;IACtB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACzC,OAAO,CAA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AAC,CAAC;AAEL,iBAAiB;AACjB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,uBAAuB,CAAC;KACpC,MAAM,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;KACpD,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAU,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAChD,MAAM,IAAA,mBAAU,EAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/commands/down.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MigrationConfig } from '../types';
|
|
2
|
-
export declare function rollbackMigrations(config: MigrationConfig, steps?: number): Promise<void>;
|
|
2
|
+
export declare function rollbackMigrations(config: MigrationConfig, steps?: number, dryRun?: boolean): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=down.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"down.d.ts","sourceRoot":"","sources":["../../src/commands/down.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"down.d.ts","sourceRoot":"","sources":["../../src/commands/down.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,eAAe,EACvB,KAAK,GAAE,MAAU,EACjB,MAAM,GAAE,OAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
package/dist/commands/down.js
CHANGED
|
@@ -1,29 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rollbackMigrations = rollbackMigrations;
|
|
4
|
-
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
6
4
|
const runner_1 = require("../core/runner");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
region: config.client.region,
|
|
11
|
-
endpoint: config.client.endpoint,
|
|
12
|
-
credentials: config.client.credentials,
|
|
13
|
-
});
|
|
14
|
-
const client = lib_dynamodb_1.DynamoDBDocumentClient.from(ddbClient, {
|
|
15
|
-
marshallOptions: {
|
|
16
|
-
removeUndefinedValues: true,
|
|
17
|
-
convertClassInstanceToMap: true,
|
|
18
|
-
},
|
|
19
|
-
unmarshallOptions: {
|
|
20
|
-
wrapNumbers: false,
|
|
21
|
-
},
|
|
22
|
-
});
|
|
5
|
+
const client_1 = require("../core/client");
|
|
6
|
+
async function rollbackMigrations(config, steps = 1, dryRun = false) {
|
|
7
|
+
const client = (0, client_1.createDynamoDBClient)(config);
|
|
23
8
|
const runner = new runner_1.MigrationRunner(client, config);
|
|
24
9
|
try {
|
|
25
|
-
const rolledBack = await runner.down(steps);
|
|
26
|
-
if (rolledBack.length > 0) {
|
|
10
|
+
const rolledBack = await runner.down(steps, dryRun);
|
|
11
|
+
if (!dryRun && rolledBack.length > 0) {
|
|
27
12
|
console.log(`\nš Successfully rolled back ${rolledBack.length} migration(s)`);
|
|
28
13
|
const currentVersion = await runner.getCurrentVersion();
|
|
29
14
|
console.log(`š Current version: ${currentVersion}\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"down.js","sourceRoot":"","sources":["../../src/commands/down.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"down.js","sourceRoot":"","sources":["../../src/commands/down.ts"],"names":[],"mappings":";;AAIA,gDAqBC;AAzBD,2CAAiD;AACjD,2CAAsD;AAG/C,KAAK,UAAU,kBAAkB,CACtC,MAAuB,EACvB,QAAgB,CAAC,EACjB,SAAkB,KAAK;IAEvB,MAAM,MAAM,GAAG,IAAA,6BAAoB,EAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,IAAI,wBAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEnD,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAEpD,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,iCAAiC,UAAU,CAAC,MAAM,eAAe,CAAC,CAAC;YAE/E,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,iBAAiB,EAAE,CAAC;YACxD,OAAO,CAAC,GAAG,CAAC,uBAAuB,cAAc,IAAI,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,wBAAwB,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAsB,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAsEvE"}
|
package/dist/commands/status.js
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.showStatus = showStatus;
|
|
4
|
-
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
6
4
|
const runner_1 = require("../core/runner");
|
|
5
|
+
const client_1 = require("../core/client");
|
|
7
6
|
async function showStatus(config) {
|
|
8
|
-
|
|
9
|
-
const ddbClient = new client_dynamodb_1.DynamoDBClient({
|
|
10
|
-
region: config.client.region,
|
|
11
|
-
endpoint: config.client.endpoint,
|
|
12
|
-
credentials: config.client.credentials,
|
|
13
|
-
});
|
|
14
|
-
const client = lib_dynamodb_1.DynamoDBDocumentClient.from(ddbClient, {
|
|
15
|
-
marshallOptions: {
|
|
16
|
-
removeUndefinedValues: true,
|
|
17
|
-
convertClassInstanceToMap: true,
|
|
18
|
-
},
|
|
19
|
-
unmarshallOptions: {
|
|
20
|
-
wrapNumbers: false,
|
|
21
|
-
},
|
|
22
|
-
});
|
|
7
|
+
const client = (0, client_1.createDynamoDBClient)(config);
|
|
23
8
|
const runner = new runner_1.MigrationRunner(client, config);
|
|
24
9
|
try {
|
|
25
10
|
const statuses = await runner.status();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":";;AAIA,gCAsEC;AA1ED,2CAAiD;AACjD,2CAAsD;AAG/C,KAAK,UAAU,UAAU,CAAC,MAAuB;IACtD,MAAM,MAAM,GAAG,IAAA,6BAAoB,EAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,IAAI,wBAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEnD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;QACvC,MAAM,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C,CAAC;gBACrD,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;oBACjB,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC;QAED,UAAU;QACV,OAAO,CAAC,GAAG,CAAC,UAAU,QAAQ,CAAC,MAAM,iBAAiB,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,6BAA6B,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/commands/up.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MigrationConfig } from '../types';
|
|
2
|
-
export declare function runMigrations(config: MigrationConfig, limit?: number): Promise<void>;
|
|
2
|
+
export declare function runMigrations(config: MigrationConfig, limit?: number, dryRun?: boolean): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=up.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAsB,aAAa,CACjC,MAAM,EAAE,eAAe,EACvB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,GAAE,OAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|