From 22ceb9701d25ef9ad44837dc0a3691cfe3517bfb Mon Sep 17 00:00:00 2001 From: DeepMind Team Date: Fri, 15 Dec 2023 00:59:58 -0800 Subject: [PATCH] Internal PiperOrigin-RevId: 591174245 Change-Id: I89853c73c38c5f177be4092a479730d3d29a005d GitOrigin-RevId: 5199d3939a41be32dee85ce1676e1fff41c98173 --- xmanager/xm_local/storage/database.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xmanager/xm_local/storage/database.py b/xmanager/xm_local/storage/database.py index 8ce7613..a1a2d05 100644 --- a/xmanager/xm_local/storage/database.py +++ b/xmanager/xm_local/storage/database.py @@ -15,6 +15,7 @@ import abc import functools import os +import tempfile from typing import Any, Dict, List, Optional, Type, TypeVar from absl import flags @@ -209,9 +210,10 @@ def __init__( self.alembic_cfg = Config(alembic_ini_path) self.alembic_cfg.set_main_option('sqlalchemy.url', str(self.engine.url)) - self.alembic_cfg.set_main_option( - 'script_location', os.path.join(storage_dir, 'alembic') - ) + + alembic_script_path = os.path.join(storage_dir, 'alembic') + + self.alembic_cfg.set_main_option('script_location', alembic_script_path) self.maybe_migrate_database_version()