From 9f779fe60fd6a1f5bb9165164cf49c7c5d899a9b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 15 Jan 2025 11:01:09 -0600 Subject: [PATCH] fix: add latest schema columns on app startup, unless not supported this works around the issue where some CORE databases are too old (etc.) and are missing some schema columns. in such cases the config for "latest columns" should be disabled; otherwise we add them to schema on startup --- src/wutta_corepos/conf.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wutta_corepos/conf.py b/src/wutta_corepos/conf.py index ef4c917..77bb6cc 100644 --- a/src/wutta_corepos/conf.py +++ b/src/wutta_corepos/conf.py @@ -100,3 +100,9 @@ class WuttaCoreposConfigExtension(WuttaConfigExtension): config.core_office_arch_engines = engines config.core_office_arch_engine = engines.get('default') Session.configure(bind=config.core_office_arch_engine) + + # define some schema columns "late" unless not supported + if config.get_bool('corepos.db.office_op.use_latest_columns', + default=True, usedb=False): + from corepos.db.office_op.model import use_latest_columns + use_latest_columns()