Files
digiserver-v2/migrate_add_orientation.py
ske087 498c03ef00 Replace emoji icons with local SVG files for consistent rendering
- Created 10 SVG icon files in app/static/icons/ (Feather Icons style)
- Updated base.html with SVG icons in navigation and dark mode toggle
- Updated dashboard.html with icons in stats cards and quick actions
- Updated content_list_new.html (playlist management) with SVG icons
- Updated upload_media.html with upload-related icons
- Updated manage_player.html with player management icons
- Icons use currentColor for automatic theme adaptation
- Removed emoji dependency for better Raspberry Pi compatibility
- Added ICON_INTEGRATION.md documentation
2025-11-13 21:00:07 +02:00

60 lines
1.8 KiB
Python

#!/usr/bin/env python3
"""Add orientation column to playlist table - Direct SQLite approach"""
import sqlite3
import os
def add_orientation_column():
"""Add orientation column to playlist table using direct SQLite connection."""
db_path = 'instance/dev.db'
if not os.path.exists(db_path):
print(f"❌ Database not found at: {db_path}")
return
print(f"📁 Opening database: {db_path}")
try:
# Connect to database
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
# Check if column already exists
cursor.execute("PRAGMA table_info(playlist)")
columns = [row[1] for row in cursor.fetchall()]
if 'orientation' in columns:
print("✅ Column 'orientation' already exists in playlist table")
conn.close()
return
# Add the column
print("Adding 'orientation' column to playlist table...")
cursor.execute("""
ALTER TABLE playlist
ADD COLUMN orientation VARCHAR(20) DEFAULT 'Landscape' NOT NULL
""")
conn.commit()
print("✅ Successfully added 'orientation' column to playlist table")
print(" Default value: 'Landscape'")
# Verify the column was added
cursor.execute("PRAGMA table_info(playlist)")
columns = [row[1] for row in cursor.fetchall()]
if 'orientation' in columns:
print("✓ Verified: Column exists in database")
conn.close()
except sqlite3.Error as e:
print(f"❌ SQLite Error: {e}")
return
except Exception as e:
print(f"❌ Error: {e}")
return
if __name__ == '__main__':
add_orientation_column()