import sqlite3 conn = sqlite3.connect("/app/autonet.db") cursor = conn.cursor() # 1. 컬럼 추가 (이미 있으면 무시) try: cursor.execute("ALTER TABLE hero_banners ADD COLUMN title_ru VARCHAR(100)") print("Added title_ru column") except: print("title_ru column already exists") try: cursor.execute("ALTER TABLE hero_banners ADD COLUMN subtitle_ru VARCHAR(200)") print("Added subtitle_ru column") except: print("subtitle_ru column already exists") conn.commit() # 2. 러시아어 번역 추가 translations = { "모하비 더 마스터": ("Mohave The Master", "Мохаве Мастер", "Мохаве Мастер"), "신형 K5(DL3)": ("New K5 (DL3)", "Шинэ K5 (DL3)", "Новый K5 (DL3)"), "더 뉴그랜드스타렉스": ("The New Grand Starex", "Шинэ Гранд Старекс", "Новый Гранд Старекс"), "더 뉴Santa Fe": ("The New Santa Fe", "Шинэ Санта Фе", "Новый Санта Фе"), "더 뉴 K7": ("The New K7", "Шинэ K7", "Новый K7"), } cursor.execute("SELECT id, title_ko FROM hero_banners") for row in cursor.fetchall(): banner_id, title_ko = row if title_ko in translations: en, mn, ru = translations[title_ko] cursor.execute( "UPDATE hero_banners SET title_en=?, title_mn=?, title_ru=? WHERE id=?", (en, mn, ru, banner_id) ) print(f"Updated banner {banner_id}: {title_ko} -> EN: {en}, MN: {mn}, RU: {ru}") conn.commit() # 3. 확인 cursor.execute("SELECT id, title_ko, title_en, title_mn, title_ru FROM hero_banners") print("\n=== Current Banner Data ===") for row in cursor.fetchall(): print(row) print("\nDone!")