-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigration.ts
More file actions
27 lines (22 loc) · 722 Bytes
/
migration.ts
File metadata and controls
27 lines (22 loc) · 722 Bytes
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
import { generateMigration, revertLastMigration, runMigrations } from '@vendure/core';
import program from 'commander';
import { config } from './src/vendure-config';
program
.command('generate <name>')
.description('Generate a new migration file with the given name')
.action(name => {
return generateMigration(config, { name, outputDir: './src/migrations' });
});
program
.command('run')
.description('Run all pending migrations')
.action(() => {
return runMigrations(config);
});
program
.command('revert')
.description('Revert the last applied migration')
.action(() => {
return revertLastMigration(config);
});
program.parse(process.argv);