feat: UI improvements and WMT sync workflow overhaul
This commit is contained in:
@@ -57,6 +57,22 @@ class DatabaseSchemaUpdater:
|
||||
except Exception as e:
|
||||
print(f" ❌ Error adding {column_name}: {e}")
|
||||
|
||||
def add_config_synced_at_column(self):
|
||||
"""Add config_synced_at column to devices table (WMT config sync tracking)"""
|
||||
print("📊 Updating devices table schema (config_synced_at)...")
|
||||
with self.engine.connect() as conn:
|
||||
try:
|
||||
result = conn.execute(text("PRAGMA table_info(devices)"))
|
||||
existing = [row[1] for row in result.fetchall()]
|
||||
if 'config_synced_at' not in existing:
|
||||
conn.execute(text("ALTER TABLE devices ADD COLUMN config_synced_at DATETIME"))
|
||||
conn.commit()
|
||||
print(" ✅ Added column: config_synced_at")
|
||||
else:
|
||||
print(" ⏭️ Column config_synced_at already exists")
|
||||
except Exception as e:
|
||||
print(f" ❌ Error adding config_synced_at: {e}")
|
||||
|
||||
def create_tables(self):
|
||||
"""Create all tables using SQLAlchemy metadata"""
|
||||
print("🏗️ Creating all database tables...")
|
||||
@@ -109,6 +125,7 @@ if __name__ == "__main__":
|
||||
|
||||
# Update schema
|
||||
updater.update_playbook_executions_schema()
|
||||
updater.add_config_synced_at_column()
|
||||
|
||||
# Verify
|
||||
if updater.verify_schema():
|
||||
|
||||
Reference in New Issue
Block a user