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 (