cleanup and working seed data
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
'use strict';
|
||||
const bcrypt = require('bcrypt-nodejs');
|
||||
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
var hashedPass = await bcrypt.hashSync('test', null);
|
||||
|
||||
return queryInterface.bulkInsert('organizations', [
|
||||
{
|
||||
name: 'Gopala Goshala',
|
||||
@@ -18,7 +21,7 @@ module.exports = {
|
||||
zip: '92604',
|
||||
|
||||
primary_cause: 'Animal',
|
||||
primary_region: 'North India',
|
||||
primary_region: 'South Asia',
|
||||
|
||||
ein: '63-6088665',
|
||||
estimate_asset_value: 200000,
|
||||
@@ -26,56 +29,82 @@ module.exports = {
|
||||
|
||||
isNonprofit: true,
|
||||
|
||||
primary_contact_phone,
|
||||
primary_contact_first_name,
|
||||
primary_contact_last_name
|
||||
},
|
||||
{
|
||||
name,
|
||||
email,
|
||||
password: hashedPass, //hashed password
|
||||
short_description,
|
||||
primary_cause,
|
||||
primary_region,
|
||||
ein,
|
||||
primary_contact_first_name,
|
||||
primary_contact_last_name,
|
||||
phone,
|
||||
country,
|
||||
address,
|
||||
city,
|
||||
zip,
|
||||
estimate_assets,
|
||||
estimate_year_operating_cost
|
||||
},
|
||||
{
|
||||
name,
|
||||
email,
|
||||
password: hashedPass, //hashed password
|
||||
short_description,
|
||||
primary_cause,
|
||||
primary_region,
|
||||
ein,
|
||||
primary_contact_first_name,
|
||||
primary_contact_last_name,
|
||||
phone,
|
||||
country,
|
||||
address,
|
||||
city,
|
||||
zip,
|
||||
estimate_assets,
|
||||
estimate_year_operating_cost
|
||||
primary_contact_phone: '9493873423',
|
||||
primary_contact_first_name: 'Kamlesh',
|
||||
primary_contact_last_name: 'Patel',
|
||||
|
||||
created_at: new Date(),
|
||||
updated_at: new Date()
|
||||
}
|
||||
// ,
|
||||
// {
|
||||
// name: 'The Pollination Project',
|
||||
// short_description:
|
||||
// 'Every day of the year, we give a grant to changemakers across the globe.',
|
||||
|
||||
// primary_contact_email: '[email protected]',
|
||||
// password: hashedPass,
|
||||
|
||||
// address: '2031 Carry Drive',
|
||||
// city: 'San Francisco',
|
||||
// country: 'USA',
|
||||
// state: 'CA',
|
||||
// zip: '92604',
|
||||
|
||||
// primary_cause: 'Animal',
|
||||
// primary_region: 'South Asia',
|
||||
|
||||
// ein: '63-6088665',
|
||||
// estimate_asset_value: 200000,
|
||||
// estimate_yearly_operating_cost: 40000,
|
||||
|
||||
// isNonprofit: true,
|
||||
|
||||
// primary_contact_phone: '6254581254',
|
||||
// primary_contact_first_name: 'Ajay',
|
||||
// primary_contact_last_name: 'Datta',
|
||||
|
||||
// created_at: new Date(),
|
||||
// updated_at: new Date()
|
||||
// },
|
||||
// {
|
||||
// name: 'Cancer Global Perspective',
|
||||
// short_description:
|
||||
// 'Your tax-deductible donation funds lifesaving research, treatment and care — and would mean so much to someone fighting cancer. Please donate today.',
|
||||
|
||||
// primary_contact_email: '[email protected]',
|
||||
// password: hashedPass,
|
||||
|
||||
// address: '82912 Larry Page Drive',
|
||||
// city: 'Holmes',
|
||||
// country: 'USA',
|
||||
// state: 'AZ',
|
||||
// zip: '92604',
|
||||
|
||||
// primary_cause: 'Animal',
|
||||
// primary_region: 'South Asia',
|
||||
|
||||
// ein: '63-6088665',
|
||||
// estimate_asset_value: 200000,
|
||||
// estimate_yearly_operating_cost: 40000,
|
||||
|
||||
// isNonprofit: true,
|
||||
|
||||
// primary_contact_phone: '6254581254',
|
||||
// primary_contact_first_name: 'Leo',
|
||||
// primary_contact_last_name: 'Rosen',
|
||||
|
||||
// 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" }
|
||||
]
|
||||
});
|
||||
return queryInterface.bulkDelete('organizations', [
|
||||
{ primary_contact_email: '[email protected]' },
|
||||
{ primary_contact_email: '[email protected]' },
|
||||
{ primary_contact_email: '[email protected]' }
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user