import sqlite3
import os

db_path = os.path.join(os.path.dirname(__file__), 'instance', 'swiftcart_cloud.db')
if not os.path.exists(db_path):
    print("Database not found at instance/swiftcart_cloud.db. Trying root.")
    db_path = os.path.join(os.path.dirname(__file__), 'swiftcart_cloud.db')

conn = sqlite3.connect(db_path)
cursor = conn.cursor()

try:
    cursor.execute("ALTER TABLE product ADD COLUMN physical_sale_video VARCHAR(500)")
    print("Column physical_sale_video added successfully.")
except sqlite3.OperationalError as e:
    print(f"Error (maybe already added): {e}")

conn.commit()
conn.close()
