Очистка временных файлов документации

This commit is contained in:
2025-11-30 14:51:24 +03:00
parent 4343b2eb5b
commit 03048b6345
8 changed files with 0 additions and 1510 deletions

View File

@@ -1,32 +0,0 @@
"""
Скрипт для создания резервов для существующих заказов
"""
import os
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
django.setup()
from django.db import connection
# Читаем SQL скрипт
with open('fix_reservations.sql', 'r', encoding='utf-8') as f:
sql = f.read()
# Выполняем SQL
with connection.cursor() as cursor:
try:
cursor.execute(sql)
print("[OK] SQL script executed successfully!")
print("\nResults:")
# Получаем результат последнего SELECT
rows = cursor.fetchall()
if rows:
row = rows[0]
print(f" Total items: {row[0]}")
print(f" Items with reservations: {row[1]}")
print(f" Items without reservations: {row[2]}")
print("\n[OK] Reservations created!")
except Exception as e:
print(f"[ERROR] {e}")
raise