Skip to content

Commit

Permalink
update create migration content at readme
Browse files Browse the repository at this point in the history
  • Loading branch information
okv committed Jan 25, 2020
1 parent 97ce9a2 commit 561fc8b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,22 @@ where `url` is url of database which you want to migrate (in
[mongodb native url connection format](http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html#the-url-connection-format)) and `options` is optional settings
(see [connect method specification](http://mongodb.github.io/node-mongodb-native/2.0/api/MongoClient.html#connect)).

Migration files created with `template` that comes with adapter will look like:
Migration files created with default `template` that comes with adapter will
look like:

```js
exports.migrate = function(client, done) {
var db = client.db;
done();
exports.tags = [];

exports.migrate = function(params) {
const db = params.db;

return Promise.resolve();
};

exports.rollback = function(client, done) {
var db = client.db;
done();
exports.rollback = function(params) {
const db = params.db;

return Promise.resolve();
};
```

Expand Down

0 comments on commit 561fc8b

Please sign in to comment.