From 26fe71a1ac1023870027551088502b4c6c0a0b3b Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 25 May 2021 15:15:36 +0100 Subject: [PATCH] fix app import to create link views and search index --- packages/server/src/api/controllers/application.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/controllers/application.js b/packages/server/src/api/controllers/application.js index 2511686bed..c018e5b017 100644 --- a/packages/server/src/api/controllers/application.js +++ b/packages/server/src/api/controllers/application.js @@ -92,10 +92,6 @@ async function createInstance(template) { // https://docs.couchdb.org/en/master/ddocs/views/collation.html#collation-specification views: {}, }) - // add view for linked rows - await createLinkView(appId) - await createRoutingView(appId) - await createAllSearchIndex(appId) // replicate the template data to the instance DB // this is currently very hard to test, downloading and importing template files @@ -110,6 +106,11 @@ async function createInstance(template) { await db.put(USERS_TABLE_SCHEMA) } + // add view for linked rows + await createLinkView(appId) + await createRoutingView(appId) + await createAllSearchIndex(appId) + return { _id: appId } }