Skip to content

Commit 6e30dca

Browse files
committed
changed restoredb timeout to 10 minutes (used to be 5)
1 parent 08c36ce commit 6e30dca

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pddev",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "Helpful console utilities for developers to use on their local machines",
55
"main": "pddev.js",
66
"bin": {

pddev-migratedbdown.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
const args = require('args');
44
const sql = require('mssql/msnodesqlv8');
55
const SqlService = require('./sql/sqlService');
6+
const SqlMigrationService = require('./sqlMigrationService');
67

78
(async () => {
89
const postgratorConfig = await require('./postgratorConfig');
910
const sqlService = new SqlService();
11+
const sqlMigrationService = new SqlMigrationService();
1012
const options = args.parse(process.argv);
1113

12-
// this is whatever is typed just after this subcommand: pddev-migratedbdown 5
14+
// this is whatever is typed just after this subcommand: pddev-migratedbdown 5 u
1315
const version = args.sub[0]; // would be 5 from above example
16+
// this is whatever is typed as second parameter after this subcommand: pddev-migratedbdown 5 u
17+
const migrateUp = args.sub[1]; // would be u from above example
1418

1519
let dbPool = {};
1620

@@ -23,6 +27,10 @@ const SqlService = require('./sql/sqlService');
2327
console.log(`connected to ${postgratorConfig.database}...`);
2428

2529
let result = await sqlService.runScript(dbPool, sqlService.scriptNames.migrateDown, `migrating down to version ${version}...`, {version: version});
30+
31+
if (migrateUp && migrateUp === 'u') {
32+
sqlMigrationService.migrateSql();
33+
}
2634
}
2735
catch (err) {
2836
console.log(err);

pddev-restoredb.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ args.option('databaseName', 'The database you want to act on');
3636
};
3737

3838
masterPool = await new sql.ConnectionPool(sqlMasterConnectionOptions).connect();
39-
masterPool.config.requestTimeout = 300000;
39+
masterPool.config.requestTimeout = 600000; // 10 min
4040
console.log('connected to master...');
4141

4242
// nuke database

0 commit comments

Comments
 (0)