Last active
October 21, 2018 19:08
-
-
Save lokhmakov/98d4625b59edafd614f85c756144d56f to your computer and use it in GitHub Desktop.
updates/0.0.2-init.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keystone = require('keystone') | |
const who = [`updates`, `0.0.2-init`] | |
const items = { | |
CoreEntity: [ | |
{ | |
name: `Person` | |
__ref: '__person', | |
}, | |
], | |
CoreField: [ | |
{ | |
name: `name`, | |
type: `String`, | |
entity: `__person`, | |
}, | |
{ | |
name: `dateOfBirth`, | |
type: `Date`, | |
entity: `__person`, | |
}, | |
{ | |
name: `friendsNumber`, | |
type: `Number`, | |
entity: `__person`, | |
}, | |
{ | |
name: `isAlive`, | |
type: `Number`, | |
entity: `__person`, | |
}, | |
] | |
} | |
const create = async (done) => { | |
keystone.createItems(items, { verbose: true }, (err, stats) => { | |
stats && console.log(...who, stats.message) | |
done(err) | |
}) | |
} | |
exports = module.exports = function (done) { | |
create(done) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment