From 942929bd9eb3999a63a363c9538899f7f83cf99d Mon Sep 17 00:00:00 2001 From: Johannes Vogel <31311694+johannes-vogel@users.noreply.github.com> Date: Mon, 3 Jul 2023 11:09:20 +0200 Subject: [PATCH] restore common check in init.js --- 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 (