Changed sites from argument query to group by network.
This commit is contained in:
@@ -437,14 +437,14 @@ const networks = [
|
||||
|
||||
exports.seed = knex => Promise.resolve()
|
||||
.then(async () => {
|
||||
const { inserted, updated } = await upsert('entities', parentNetworks, 'slug', knex);
|
||||
const { inserted, updated } = await upsert('entities', parentNetworks.map(network => ({ ...network, type: 1 })), ['slug', 'type'], knex);
|
||||
const parentNetworksBySlug = [].concat(inserted, updated).reduce((acc, network) => ({ ...acc, [network.slug]: network.id }), {});
|
||||
|
||||
const networksWithParent = networks.map(network => ({
|
||||
slug: network.slug,
|
||||
name: network.name,
|
||||
type: network.type || 1,
|
||||
alias: (network.alias || []).join(','),
|
||||
alias: network.alias ? network.alias.join(',') : null,
|
||||
url: network.url,
|
||||
description: network.description,
|
||||
parameters: network.parameters,
|
||||
|
||||
Reference in New Issue
Block a user