Files
ComfyUI/comfy
Constantine 5f0c4e18cb Fix default database path for custom user directory (#14539)
* fix: respect user directory for default database

* refactor: use None default for --database-url instead of argv scan

Per review: default --database-url to None and treat a non-None value
as explicit at resolution time. Removes the sys.argv scan and the
database_url_explicit attribute. database_default_path now serves
directly as the legacy copy source. Adds regression tests for the
unchanged no-flag default path and explicit URLs at the legacy
location.

* refactor: rename legacy database to .bak after copy

Per review: after copying the legacy install-dir database to the
effective user directory, rename the original to comfyui.db.bak so a
later launch without --user-directory cannot silently fall back to a
diverged copy, while keeping the file around for recovery. Also hoist
the database_default_path import to module scope.

* fix: guard legacy migration on existing .bak and rename before copy

Per review: bail out of the legacy migration when comfyui.db.bak
already exists, so only the first run migrates and later launches with
a fresh --user-directory cannot grab a database another instance is
using. Rename before copy so os.replace fails fast if the legacy DB is
held open by a running instance.

---------

Co-authored-by: guill <jacob.e.segal@gmail.com>
2026-08-24 16:19:03 -07:00
..
2024-06-27 18:43:11 -04:00
2026-08-17 23:20:28 -04:00
2026-02-26 01:30:31 -05:00
2025-01-24 06:15:54 -05:00
2025-07-06 07:07:39 -04:00
2026-05-08 17:14:45 +08:00
2026-06-22 14:35:00 -07:00