Adding networks and sites as entities,
This commit is contained in:
@@ -430,7 +430,7 @@ const networks = [
|
||||
|
||||
exports.seed = knex => Promise.resolve()
|
||||
.then(async () => {
|
||||
const { inserted, updated } = await upsert('networks', parentNetworks, 'slug', knex);
|
||||
const { inserted, updated } = await upsert('entities', parentNetworks, 'slug', knex);
|
||||
const parentNetworksBySlug = [].concat(inserted, updated).reduce((acc, network) => ({ ...acc, [network.slug]: network.id }), {});
|
||||
|
||||
const networksWithParent = networks.map(network => ({
|
||||
@@ -443,5 +443,5 @@ exports.seed = knex => Promise.resolve()
|
||||
parent_id: parentNetworksBySlug[network.parent] || null,
|
||||
}));
|
||||
|
||||
return upsert('networks', networksWithParent, 'slug', knex);
|
||||
return upsert('entities', networksWithParent, 'slug', knex);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user