pgroll 0.0.5 → 0.0.6
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/dist/cjs/src/cli.js +5 -1
- package/dist/esm/src/cli.js +5 -1
- package/package.json +1 -1
package/dist/cjs/src/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ let migrator;
|
|
|
11
11
|
program
|
|
12
12
|
.version('0.0.1')
|
|
13
13
|
.description('Database migration tool')
|
|
14
|
-
.option('-d, --migrationDir <filepath>', 'Specify migration directory(Default: ./
|
|
14
|
+
.option('-d, --migrationDir <filepath>', 'Specify migration directory(Default: ./migrations)')
|
|
15
15
|
.hook('preAction', cmd => {
|
|
16
16
|
const opts = cmd.opts();
|
|
17
17
|
migrator = new index_1.Migrator((0, postgres_1.default)(), opts.migrationDir);
|
|
@@ -23,6 +23,7 @@ program
|
|
|
23
23
|
try {
|
|
24
24
|
yield migrator.up({ eventHandler: console.log });
|
|
25
25
|
console.log('Migrations up completed successfully.');
|
|
26
|
+
process.exit(0);
|
|
26
27
|
}
|
|
27
28
|
catch (error) {
|
|
28
29
|
console.error('Error during migrations up:', error);
|
|
@@ -36,6 +37,7 @@ program
|
|
|
36
37
|
try {
|
|
37
38
|
yield migrator.down({ eventHandler: console.log });
|
|
38
39
|
console.log('Migrations down completed successfully.');
|
|
40
|
+
process.exit(0);
|
|
39
41
|
}
|
|
40
42
|
catch (error) {
|
|
41
43
|
console.error('Error during migrations down:', error);
|
|
@@ -50,6 +52,7 @@ program
|
|
|
50
52
|
const result = (0, utils_1.createFile)(migrator.migrationsDir, fileName);
|
|
51
53
|
for (const f of result)
|
|
52
54
|
console.log(`Successfully created migration files: ${f}`);
|
|
55
|
+
process.exit(0);
|
|
53
56
|
});
|
|
54
57
|
program
|
|
55
58
|
.command('go')
|
|
@@ -63,6 +66,7 @@ program
|
|
|
63
66
|
}
|
|
64
67
|
try {
|
|
65
68
|
yield migrator.go(parsedVersion, { eventHandler: console.log });
|
|
69
|
+
process.exit(0);
|
|
66
70
|
}
|
|
67
71
|
catch (error) {
|
|
68
72
|
console.error('Error during migrations:', error);
|
package/dist/esm/src/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ let migrator;
|
|
|
9
9
|
program
|
|
10
10
|
.version('0.0.1')
|
|
11
11
|
.description('Database migration tool')
|
|
12
|
-
.option('-d, --migrationDir <filepath>', 'Specify migration directory(Default: ./
|
|
12
|
+
.option('-d, --migrationDir <filepath>', 'Specify migration directory(Default: ./migrations)')
|
|
13
13
|
.hook('preAction', cmd => {
|
|
14
14
|
const opts = cmd.opts();
|
|
15
15
|
migrator = new Migrator(postgres(), opts.migrationDir);
|
|
@@ -21,6 +21,7 @@ program
|
|
|
21
21
|
try {
|
|
22
22
|
yield migrator.up({ eventHandler: console.log });
|
|
23
23
|
console.log('Migrations up completed successfully.');
|
|
24
|
+
process.exit(0);
|
|
24
25
|
}
|
|
25
26
|
catch (error) {
|
|
26
27
|
console.error('Error during migrations up:', error);
|
|
@@ -34,6 +35,7 @@ program
|
|
|
34
35
|
try {
|
|
35
36
|
yield migrator.down({ eventHandler: console.log });
|
|
36
37
|
console.log('Migrations down completed successfully.');
|
|
38
|
+
process.exit(0);
|
|
37
39
|
}
|
|
38
40
|
catch (error) {
|
|
39
41
|
console.error('Error during migrations down:', error);
|
|
@@ -48,6 +50,7 @@ program
|
|
|
48
50
|
const result = createFile(migrator.migrationsDir, fileName);
|
|
49
51
|
for (const f of result)
|
|
50
52
|
console.log(`Successfully created migration files: ${f}`);
|
|
53
|
+
process.exit(0);
|
|
51
54
|
});
|
|
52
55
|
program
|
|
53
56
|
.command('go')
|
|
@@ -61,6 +64,7 @@ program
|
|
|
61
64
|
}
|
|
62
65
|
try {
|
|
63
66
|
yield migrator.go(parsedVersion, { eventHandler: console.log });
|
|
67
|
+
process.exit(0);
|
|
64
68
|
}
|
|
65
69
|
catch (error) {
|
|
66
70
|
console.error('Error during migrations:', error);
|