Skip to content

Instantly share code, notes, and snippets.

@cahlan
Created February 12, 2015 20:54
Show Gist options
  • Save cahlan/c5e1f30964599f80d92e to your computer and use it in GitHub Desktop.
Save cahlan/c5e1f30964599f80d92e to your computer and use it in GitHub Desktop.
var Product = require('../models/product');
require('../server');//this makes sure the db is connected
exports.up = function(next){
var watch = new Product({
name: 'Rolex Watch'
description: 'One of the most expensive, luxurious items around.',
price: 3500000,
active: true
});
watch.save(function(err) {
if (err) {
console.log(err);
next(err);
}
else {
console.log("seed data included");
next();
}
});
};
exports.down = function(next){
next();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment