Comparing version 0.1.5 to 0.1.6
@@ -63,3 +63,15 @@ 'use strict'; | ||
); | ||
fs.mkdirSync(this.params.dir); | ||
function mkdirpSync(dir) { | ||
try { | ||
fs.mkdirSync(dir); | ||
} catch(err) { | ||
if (err.code == 'ENOENT') { | ||
mkdirpSync(path.dirname(dir)); | ||
mkdirpSync(dir); | ||
} else { | ||
throw err; | ||
} | ||
} | ||
} | ||
mkdirpSync(this.params.dir); | ||
callback(); | ||
@@ -143,3 +155,3 @@ }; | ||
Migrator.prototype.getMigrationPathByName = function(name) { | ||
return path.join(this.params.dir, name + '.js'); | ||
return path.resolve(path.join(this.params.dir, name + '.js')); | ||
}; | ||
@@ -146,0 +158,0 @@ |
{ | ||
"name": "east", | ||
"description": "node.js database migration tool", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"author": "Oleg Korobenko <oleg.korobenko@gmail.com>", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -94,3 +94,3 @@ # east | ||
error occured you can pass it as first argument) | ||
migration also can be synchronous - declare only client at `migrate` or `rollback` | ||
migration also can be synchronous - declare only `client` at `migrate` or `rollback` | ||
`rollback` function is optional and may be omitted | ||
@@ -152,3 +152,3 @@ | ||
```sh | ||
east migrate 1_doSomething,2_doSomethingElse | ||
east migrate 1_doSomething,2 | ||
``` | ||
@@ -194,3 +194,3 @@ | ||
shows new migration e.g. | ||
shows new migrations e.g. | ||
@@ -197,0 +197,0 @@ ```sh |
24446
6
413