Skip to content

Commit b2a77bc

Browse files
committed
merge fixes
2 parents dbb8fe4 + 392d88c commit b2a77bc

19 files changed

+462
-356
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## I'm submitting a...
2+
<!-- Check one of the following options with "x" -->
3+
<pre><code>
4+
[ ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
5+
[ ] Feature request
6+
</code></pre>
7+
8+
## Current behavior
9+
<!-- Describe how the issue manifests. -->
10+
11+
12+
## Expected behavior
13+
<!-- Describe what the desired behavior would be. -->
14+
15+
16+
## Minimal reproduction of the problem with instructions
17+
18+
## What is the motivation / use case for changing the behavior?
19+
<!-- Describe the motivation or the concrete use case. -->
20+
21+
22+
## Environment
23+
24+
<pre><code>
25+
db-migrate version: X.Y.Z
26+
plugins with versions: X.Y.Z
27+
db-migrate driver with versions: <!-- eg. mongodb vX.Y.Z -->
28+
29+
Additional information:
30+
- Node version: XX <!-- run `node --version` -->
31+
- Platform: <!-- Mac, Linux, Windows -->
32+
33+
Others:
34+
<!-- Anything else relevant? Operating system version, IDE, package manager, HTTP server, ... -->
35+
</code></pre>

.github/stale.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 30
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 7
5+
# Issues with these labels will never be considered stale
6+
exemptLabels:
7+
- feature
8+
- Refactoring
9+
- RFC
10+
- bug
11+
- documentation
12+
- bounty
13+
- pinned
14+
- security
15+
# Label to use when marking an issue as stale
16+
staleLabel: stale
17+
# Comment to post when marking an issue as stale. Set to `false` to disable
18+
markComment: >
19+
This issue has been automatically marked as stale because it has not had
20+
recent activity. It will be closed if no further activity occurs. Thank you
21+
for your contributions.
22+
# Comment to post when closing a stale issue. Set to `false` to disable
23+
closeComment: false

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.github
12
test
23
migrations
34
VCSeeder

.travis.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
language: node_js
22

33
node_js:
4-
- 4.0
5-
- 4.2
6-
- 5
4+
- 4
75
- 6
6+
- 8
7+
- node
88

99
notifications:
1010
email:
@@ -21,6 +21,8 @@ os:
2121
- linux
2222

2323
matrix:
24+
allow_failures:
25+
- node_js: node
2426
fast_finish: true
2527

2628
sudo: false
@@ -41,4 +43,4 @@ before_install:
4143
- export CXX=g++-4.8; export CC=gcc-4.8;
4244

4345
before_script:
44-
- cp test/db.config.ci test/db.config.json
46+
- cp test/db.config.ci test/db.config.json

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function dbmigrate (plugins, isModule, options, callback) {
4242
});
4343

4444
/* $lab:coverage:off$ */
45-
if (options && !options.throwUncatched) load('helper/register-events')();
45+
if (!options || !options.throwUncatched) load('helper/register-events')();
4646
/* $lab:coverage:on$ */
4747

4848
if (typeof options === 'object') {

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-angular'] };

connect.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ exports.connect = function (config, PassedClass, callback) {
3939
} catch (e) {}
4040

4141
if (switched) {
42-
db.switchDatabase(newConf, function () {
42+
db.switchDatabase(newConf, function (err) {
43+
if (err) {
44+
return callback(err);
45+
}
4346
internals.locTitle = internals.migrationMode;
4447
callback(
4548
null,

lib/commands/db.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ function executeDB (internals, config, callback) {
2525
function (err) {
2626
if (err) {
2727
if (err.error) err = err.error;
28-
log.info('Error: Failed to create database!', err);
28+
log.error('Error: Failed to create database!', err);
2929
} else {
3030
log.info('Created database "' + internals.argv.dbname + '"');
3131
}
3232

3333
db.close();
34-
if (typeof callback === 'function') callback();
34+
if (typeof callback === 'function') callback(err);
35+
else process.exit(1);
3536
}
3637
);
3738
} else if (internals.mode === 'drop') {
@@ -43,13 +44,14 @@ function executeDB (internals, config, callback) {
4344
function (err) {
4445
if (err) {
4546
if (err.error) err = err.error;
46-
log.info('Error: Failed to drop database!', err);
47+
log.error('Error: Failed to drop database!', err);
4748
} else {
4849
log.info('Deleted database "' + internals.argv.dbname + '"');
4950
}
5051

5152
db.close();
52-
if (typeof callback === 'function') callback();
53+
if (typeof callback === 'function') callback(err);
54+
process.exit(1);
5355
}
5456
);
5557
}

lib/commands/set-default-argv.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ module.exports = function (internals, isModule) {
119119

120120
internals.argv = deepExtend(internals.argv.argv, rc('db-migrate', {}));
121121
internals.argv.rcconfig = internals.argv.config;
122-
internals.argv.config = _config;
122+
internals.argv.config = internals.argv.configFile || _config;
123123

124124
if (internals.argv.version) {
125125
console.log(internals.dbm.version);

0 commit comments

Comments
 (0)