exports.seed = function(knex) { return knex('tenants').select('tenant').first() .then((tenant) => { if (!tenant) return; return knex('impacts').insert([ { tenant: tenant.tenant, impact_name: 'Individual Inconvenience', created_by: knex('users') .where({ tenant: tenant.tenant, username: 'glinda' }) .select('user_id') .first() }, { tenant: tenant.tenant, impact_name: 'Local Disruption', created_by: knex('users') .where({ tenant: tenant.tenant, username: 'glinda' }) .select('user_id') .first() }, { tenant: tenant.tenant, impact_name: 'Realm-Wide Repercussions', created_by: knex('users') .where({ tenant: tenant.tenant, username: 'glinda' }) .select('user_id') .first() } ]); }); };