There was an error while loading. Please reload this page.
1 parent 71de8ac commit 30cd74eCopy full SHA for 30cd74e
1 file changed
src/basic_memory/db.py
@@ -137,8 +137,14 @@ async def run_migrations(app_config: ProjectConfig, database_type=DatabaseType.F
137
# Get the absolute path to the alembic directory relative to this file
138
alembic_dir = Path(__file__).parent / "alembic"
139
config = Config()
140
+
141
+ # Set required Alembic config options programmatically
142
config.set_main_option("script_location", str(alembic_dir))
- config.set_main_option("sqlalchemy.url", "driver://user:pass@localhost/dbname")
143
+ config.set_main_option("file_template",
144
+ "%%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s")
145
+ config.set_main_option("timezone", "UTC")
146
+ config.set_main_option("revision_environment", "false")
147
+ config.set_main_option("sqlalchemy.url", DatabaseType.get_db_url(app_config.database_path, database_type))
148
149
command.upgrade(config, "head")
150
logger.info("Migrations completed successfully")
0 commit comments