From b6a88396d1e782ec7975966d02960bbe23d4e846 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Sat, 13 Apr 2019 20:18:42 -0700 Subject: [PATCH] making seeders automatically verified orgs --- seeders/20190122053544-base-orgs.js | 173 ++++++++++++++-------------- 1 file changed, 88 insertions(+), 85 deletions(-) diff --git a/seeders/20190122053544-base-orgs.js b/seeders/20190122053544-base-orgs.js index 6fc6341..2e477a5 100644 --- a/seeders/20190122053544-base-orgs.js +++ b/seeders/20190122053544-base-orgs.js @@ -1,113 +1,116 @@ 'use strict'; const bcrypt = require('bcrypt-nodejs'), - uuidv4 = require('uuid/v4'); + uuidv4 = require('uuid/v4'); module.exports = { - up: async (queryInterface, Sequelize) => { - var hashedPass = await bcrypt.hashSync('test', null); + up: async (queryInterface, Sequelize) => { + var hashedPass = await bcrypt.hashSync('test', null); - return queryInterface.bulkInsert('organizations', [ - { - id: uuidv4(), - name: 'Gopala Goshala', - 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', + return queryInterface.bulkInsert('organizations', [ + { + id: uuidv4(), + name: 'Gopala Goshala', + 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', - primary_contact_email: 'kcp1982@yahoo.com', - password: hashedPass, + primary_contact_email: 'kcp1982@yahoo.com', + password: hashedPass, - address: '14872 Waverly Lane', - city: 'Irvine', - country: 'USA', - state: 'CA', - zip: '92604', + address: '14872 Waverly Lane', + city: 'Irvine', + country: 'USA', + state: 'CA', + zip: '92604', - primary_cause: 'Animal', - primary_region: 'Southern Asia', + primary_cause: 'Animal', + primary_region: 'Southern Asia', - ein: '63-6088665', - estimate_asset_value: 200000, - estimate_yearly_operating_cost: 40000, + ein: '63-6088665', + estimate_asset_value: 200000, + estimate_yearly_operating_cost: 40000, - is_nonprofit: true, + is_nonprofit: true, + is_verified: true, - primary_contact_phone: '9493873423', - primary_contact_first_name: 'Kamlesh', - primary_contact_last_name: 'Patel', + primary_contact_phone: '9493873423', + primary_contact_first_name: 'Kamlesh', + primary_contact_last_name: 'Patel', - created_at: new Date(), - updated_at: new Date() - }, - { - id: uuidv4(), - name: 'The Pollination Project', - short_description: - 'Every day of the year, we give a grant to changemakers across the globe.', + created_at: new Date(), + updated_at: new Date() + }, + { + id: uuidv4(), + name: 'The Pollination Project', + short_description: + 'Every day of the year, we give a grant to changemakers across the globe.', - primary_contact_email: 'ajay@gmail.com', - password: hashedPass, + primary_contact_email: 'ajay@gmail.com', + password: hashedPass, - address: '2031 Carry Drive', - city: 'San Francisco', - country: 'USA', - state: 'CA', - zip: '92604', + address: '2031 Carry Drive', + city: 'San Francisco', + country: 'USA', + state: 'CA', + zip: '92604', - primary_cause: 'Human Services', - primary_region: 'Africa', + primary_cause: 'Human Services', + primary_region: 'Africa', - ein: '63-6088665', - estimate_asset_value: 200000, - estimate_yearly_operating_cost: 40000, + ein: '63-6088665', + estimate_asset_value: 200000, + estimate_yearly_operating_cost: 40000, - is_nonprofit: true, + is_nonprofit: true, + is_verified: true, - primary_contact_phone: '6254581254', - primary_contact_first_name: 'Ajay', - primary_contact_last_name: 'Datta', + primary_contact_phone: '6254581254', + primary_contact_first_name: 'Ajay', + primary_contact_last_name: 'Datta', - created_at: new Date(), - updated_at: new Date() - }, - { - id: uuidv4(), - 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.', + created_at: new Date(), + updated_at: new Date() + }, + { + id: uuidv4(), + 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: 'cancersupport@gmail.com', - password: hashedPass, + primary_contact_email: 'cancersupport@gmail.com', + password: hashedPass, - address: '82912 Larry Page Drive', - city: 'Holmes', - country: 'USA', - state: 'AZ', - zip: '92604', + address: '82912 Larry Page Drive', + city: 'Holmes', + country: 'USA', + state: 'AZ', + zip: '92604', - primary_cause: 'Animal', - primary_region: 'Southern Asia', + primary_cause: 'Animal', + primary_region: 'Southern Asia', - ein: '63-6088665', - estimate_asset_value: 200000, - estimate_yearly_operating_cost: 40000, + ein: '63-6088665', + estimate_asset_value: 200000, + estimate_yearly_operating_cost: 40000, - is_nonprofit: true, + is_nonprofit: true, + is_verified: true, - primary_contact_phone: '6254581254', - primary_contact_first_name: 'Leo', - primary_contact_last_name: 'Rosen', + primary_contact_phone: '6254581254', + primary_contact_first_name: 'Leo', + primary_contact_last_name: 'Rosen', - created_at: new Date(), - updated_at: new Date() - } - ]); - }, + created_at: new Date(), + updated_at: new Date() + } + ]); + }, - down: (queryInterface, Sequelize) => { - return queryInterface.bulkDelete('organizations', [ - { primary_contact_email: 'kcp1982@yahoo.com' }, - { primary_contact_email: 'ajay@gmail.com' }, - { primary_contact_email: 'cancersupport@gmail.com' } - ]); - } + down: (queryInterface, Sequelize) => { + return queryInterface.bulkDelete('organizations', [ + { primary_contact_email: 'kcp1982@yahoo.com' }, + { primary_contact_email: 'ajay@gmail.com' }, + { primary_contact_email: 'cancersupport@gmail.com' } + ]); + } };