This commit is contained in:
2026-03-16 18:57:22 +03:00
parent 65eca64a5f
commit 668e62d652
18 changed files with 6386 additions and 1347 deletions

49
migrate_experience.py Normal file
View File

@@ -0,0 +1,49 @@
# migrate_experience.py
import sqlite3
DB_NAME = "rabota_today.db"
def add_description_column():
"""Добавление поля description в таблицу work_experience"""
conn = sqlite3.connect(DB_NAME)
cursor = conn.cursor()
try:
# Проверяем существующие колонки
cursor.execute("PRAGMA table_info(work_experience)")
columns = [col[1] for col in cursor.fetchall()]
print("📊 Текущие колонки в таблице work_experience:", columns)
# Добавляем колонку description, если её нет
if 'description' not in columns:
print(" Добавление колонки description...")
cursor.execute("ALTER TABLE work_experience ADD COLUMN description TEXT")
print("✅ Колонка description добавлена")
conn.commit()
print("\n🎉 Миграция успешно завершена!")
# Показываем обновленную структуру
cursor.execute("PRAGMA table_info(work_experience)")
new_columns = [col[1] for col in cursor.fetchall()]
print("\n📊 Обновленные колонки:", new_columns)
except Exception as e:
print(f"❌ Ошибка: {e}")
conn.rollback()
finally:
conn.close()
if __name__ == "__main__":
print("=" * 50)
print("🚀 Миграция таблицы work_experience")
print("=" * 50)
response = input("Добавить поле description? (y/n): ")
if response.lower() == 'y':
add_description_column()
else:
print("❌ Миграция отменена")