From b75ac9b7ff396fd028614cfc9770ada151497c23 Mon Sep 17 00:00:00 2001 From: Alex Wolf Date: Tue, 31 Dec 2024 18:27:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Start=20to=20migrate=20existing?= =?UTF-8?q?=20instances?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lamindb_setup/_connect_instance.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lamindb_setup/_connect_instance.py b/lamindb_setup/_connect_instance.py index 7a9a5a4e..4691cce6 100644 --- a/lamindb_setup/_connect_instance.py +++ b/lamindb_setup/_connect_instance.py @@ -299,11 +299,13 @@ def connect(slug: str, **kwargs) -> str | tuple | None: settings._instance_settings = None raise e # migrate away from lnschema-core - (settings_dir / f"no_lnschema_core-{isettings.slug.replace('/', '')}") - # if not no_lnschema_core_file.exists(): - # migrate_lnschema_core( - # isettings, no_lnschema_core_file, write_file=_write_settings - # ) + no_lnschema_core_file = ( + settings_dir / f"no_lnschema_core-{isettings.slug.replace('/', '--')}" + ) + if not no_lnschema_core_file.exists(): + migrate_lnschema_core( + isettings, no_lnschema_core_file, write_file=_write_settings + ) return None @@ -342,7 +344,6 @@ def migrate_lnschema_core( cur = conn.cursor() try: - # check if bionty_source table exists if db_type == "sqlite": cur.execute( "SELECT name FROM sqlite_master WHERE type='table' AND name='lnschema_core_user'"