From 68f8a4fe7b0698a7fe6093687f529379cc497531 Mon Sep 17 00:00:00 2001 From: Johannes Vogel <31311694+johannes-vogel@users.noreply.github.com> Date: Mon, 3 Jul 2023 12:27:55 +0200 Subject: [PATCH] restore common check in init.js (#535) --- bookshop/db/init.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bookshop/db/init.js b/bookshop/db/init.js index 6e2084f7..89304756 100644 --- a/bookshop/db/init.js +++ b/bookshop/db/init.js @@ -4,7 +4,10 @@ * currencies, if not obtained through @capire/common. */ -module.exports = async ()=>{ +module.exports = async (tx)=>{ + const has_common = tx.model.definitions['sap.common.Currencies']?.elements.numcode + if (has_common) return + await UPSERT.into ('sap.common.Currencies') .columns ( [ 'code', 'symbol', 'name' ] ) .rows (