changing base regions for seed data

This commit is contained in:
talksik
2019-04-11 00:49:39 -07:00
parent 750dbbc96e
commit ee52f38d48
2 changed files with 165 additions and 181 deletions
+80 -96
View File
@@ -1,101 +1,85 @@
'use strict'; 'use strict';
module.exports = { module.exports = {
up: (queryInterface, Sequelize) => { up: (queryInterface, Sequelize) => {
return queryInterface.bulkInsert('regions', [ return queryInterface.bulkInsert('regions', [
{ {
name: 'Africa', name: 'Africa',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, },
{ {
name: 'East Asia', name: 'Eastern Asia',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, },
{ {
name: 'South Asia', name: 'Southern Asia',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, },
{ {
name: 'Central America', name: 'Central America',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, },
{ {
name: 'North America', name: 'North America',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, },
{ {
name: 'South America', name: 'South America',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, },
{ {
name: 'Eastern Europe', name: 'Western Europe',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, },
{ {
name: 'Western Europe', name: 'Middle East',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, },
{ {
name: 'Middle East', name: 'Oceania',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, }
{ ]);
name: 'Oceania', },
created_at: new Date(),
updated_at: new Date()
},
{
name: 'Caribbean',
created_at: new Date(),
updated_at: new Date()
}
]);
},
down: (queryInterface, Sequelize) => { down: (queryInterface, Sequelize) => {
return queryInterface.bulkDelete('regions', [ return queryInterface.bulkDelete('regions', [
{ {
name: 'Africa' name: 'Africa'
}, },
{ {
name: 'East Asia' name: 'Eastern Asia'
}, },
{ {
name: 'South Asia' name: 'Southern Asia'
}, },
{ {
name: 'Central America' name: 'Central America'
}, },
{ {
name: 'North America' name: 'North America'
}, },
{ {
name: 'South America' name: 'South America'
}, },
{ {
name: 'Eastern Europe' name: 'Western Europe'
}, },
{ {
name: 'Western Europe' name: 'Middle East'
}, },
{ {
name: 'Middle East' name: 'Oceania'
}, }
{ ]);
name: 'Oceania' }
},
{
name: 'Caribbean'
}
]);
}
}; };
+85 -85
View File
@@ -1,113 +1,113 @@
'use strict'; 'use strict';
const bcrypt = require('bcrypt-nodejs'), const bcrypt = require('bcrypt-nodejs'),
uuidv4 = require('uuid/v4'); uuidv4 = require('uuid/v4');
module.exports = { module.exports = {
up: async (queryInterface, Sequelize) => { up: async (queryInterface, Sequelize) => {
var hashedPass = await bcrypt.hashSync('test', null); var hashedPass = await bcrypt.hashSync('test', null);
return queryInterface.bulkInsert('organizations', [ return queryInterface.bulkInsert('organizations', [
{ {
id: uuidv4(), id: uuidv4(),
name: 'Gopala Goshala', name: 'Gopala Goshala',
short_description: short_description:
'We are focused on bringing lawful animal treatment in North India. Check out our many projects such as city water fountains for animals', 'We are focused on bringing lawful animal treatment in North India. Check out our many projects such as city water fountains for animals',
primary_contact_email: '[email protected]', primary_contact_email: '[email protected]',
password: hashedPass, password: hashedPass,
address: '14872 Waverly Lane', address: '14872 Waverly Lane',
city: 'Irvine', city: 'Irvine',
country: 'USA', country: 'USA',
state: 'CA', state: 'CA',
zip: '92604', zip: '92604',
primary_cause: 'Animal', primary_cause: 'Animal',
primary_region: 'South Asia', primary_region: 'Southern Asia',
ein: '63-6088665', ein: '63-6088665',
estimate_asset_value: 200000, estimate_asset_value: 200000,
estimate_yearly_operating_cost: 40000, estimate_yearly_operating_cost: 40000,
is_nonprofit: true, is_nonprofit: true,
primary_contact_phone: '9493873423', primary_contact_phone: '9493873423',
primary_contact_first_name: 'Kamlesh', primary_contact_first_name: 'Kamlesh',
primary_contact_last_name: 'Patel', primary_contact_last_name: 'Patel',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, },
{ {
id: uuidv4(), id: uuidv4(),
name: 'The Pollination Project', name: 'The Pollination Project',
short_description: short_description:
'Every day of the year, we give a grant to changemakers across the globe.', 'Every day of the year, we give a grant to changemakers across the globe.',
primary_contact_email: '[email protected]', primary_contact_email: '[email protected]',
password: hashedPass, password: hashedPass,
address: '2031 Carry Drive', address: '2031 Carry Drive',
city: 'San Francisco', city: 'San Francisco',
country: 'USA', country: 'USA',
state: 'CA', state: 'CA',
zip: '92604', zip: '92604',
primary_cause: 'Human Services', primary_cause: 'Human Services',
primary_region: 'Africa', primary_region: 'Africa',
ein: '63-6088665', ein: '63-6088665',
estimate_asset_value: 200000, estimate_asset_value: 200000,
estimate_yearly_operating_cost: 40000, estimate_yearly_operating_cost: 40000,
is_nonprofit: true, is_nonprofit: true,
primary_contact_phone: '6254581254', primary_contact_phone: '6254581254',
primary_contact_first_name: 'Ajay', primary_contact_first_name: 'Ajay',
primary_contact_last_name: 'Datta', primary_contact_last_name: 'Datta',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}, },
{ {
id: uuidv4(), id: uuidv4(),
name: 'Cancer Global Perspective', name: 'Cancer Global Perspective',
short_description: short_description:
'Your tax-deductible donation funds lifesaving research, treatment and care — and would mean so much to someone fighting cancer. Please donate today.', '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]', primary_contact_email: '[email protected]',
password: hashedPass, password: hashedPass,
address: '82912 Larry Page Drive', address: '82912 Larry Page Drive',
city: 'Holmes', city: 'Holmes',
country: 'USA', country: 'USA',
state: 'AZ', state: 'AZ',
zip: '92604', zip: '92604',
primary_cause: 'Animal', primary_cause: 'Animal',
primary_region: 'South Asia', primary_region: 'Southern Asia',
ein: '63-6088665', ein: '63-6088665',
estimate_asset_value: 200000, estimate_asset_value: 200000,
estimate_yearly_operating_cost: 40000, estimate_yearly_operating_cost: 40000,
is_nonprofit: true, is_nonprofit: true,
primary_contact_phone: '6254581254', primary_contact_phone: '6254581254',
primary_contact_first_name: 'Leo', primary_contact_first_name: 'Leo',
primary_contact_last_name: 'Rosen', primary_contact_last_name: 'Rosen',
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
} }
]); ]);
}, },
down: (queryInterface, Sequelize) => { down: (queryInterface, Sequelize) => {
return queryInterface.bulkDelete('organizations', [ return queryInterface.bulkDelete('organizations', [
{ primary_contact_email: '[email protected]' }, { primary_contact_email: '[email protected]' },
{ primary_contact_email: '[email protected]' }, { primary_contact_email: '[email protected]' },
{ primary_contact_email: '[email protected]' } { primary_contact_email: '[email protected]' }
]); ]);
} }
}; };