integration with migrations/seeds/etc

This commit is contained in:
Arjun Patel
2019-01-21 22:49:54 -08:00
parent 33afb962ae
commit 6e6eba3de4
9 changed files with 267 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.bulkInsert('organizations', [
{
id: 1,
name: 'Gopala Goshala',
short_description: 'We are committed to animal shelter!',
primary_cause: 'Animal Care',
primary_region: 'North India',
rating: 9.2,
created_at: new Date(),
updated_at: new Date()
},
{
id: 2,
name: 'Water Organization India',
short_description: 'We love water! So should you!',
primary_cause: 'Water',
primary_region: 'North India',
rating: 8,
created_at: new Date(),
updated_at: new Date()
},
{
id: 3,
name: "Pete's Animals",
short_description: 'Help us protect animals!',
primary_cause: 'Animal Care',
primary_region: 'North India',
rating: 7.5,
created_at: new Date(),
updated_at: new Date()
}
]);
},
down: (queryInterface, Sequelize) => {
return queryInterface.bulkDelete('organizations', {
[Sequelize.Op.or]: [
{ name: 'Gopala Goshala' },
{ name: 'Water Organization India' },
{ name: "Pete's Animals" }
]
});
}
};