Compare commits

..

2 Commits

Author SHA1 Message Date
97b20d799e Merge pull request 'database fix' (#10) from v2 into main
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #10
2025-09-05 05:41:07 +00:00
f1d782bb74 database fix
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-09-05 14:40:25 +09:00

4
db.py
View File

@@ -14,8 +14,8 @@ if DATABASE_URL.startswith("sqlite+aiosqlite:///"):
# Создаём директорию только если она не равна текущей ('.') и не пустая
if db_dir and db_dir != os.path.abspath("") and db_dir != '.' and not os.path.exists(db_dir):
os.makedirs(db_dir, exist_ok=True)
# Если по этому пути уже есть папка, удаляем её и создаём файл
if os.path.isdir(abs_db_path):
# Если по этому пути уже есть папка, удаляем её
if os.path.exists(abs_db_path) and os.path.isdir(abs_db_path):
import shutil
shutil.rmtree(abs_db_path)
# Если файла нет, создаём пустой файл