0.4.2 - Early implementation of SLMs. WIP.

This commit is contained in:
serversdwn
2026-01-06 07:50:58 +00:00
parent 96cb27ef83
commit 4d74eda65f
36 changed files with 4211 additions and 12 deletions

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env python3
"""
Update DEV database schema to match current models
"""
from sqlalchemy import create_engine, inspect
from backend.models import Base
# DEV database
DEV_DB_URL = "sqlite:///./data-dev/seismo_fleet.db"
def update_schema():
print("Updating DEV database schema...")
print("=" * 60)
engine = create_engine(DEV_DB_URL, connect_args={"check_same_thread": False})
# Create all tables (will update existing tables with new columns)
Base.metadata.create_all(bind=engine)
# Inspect to see what we have
inspector = inspect(engine)
tables = inspector.get_table_names()
print(f"Tables in DEV database: {tables}")
if 'roster' in tables:
columns = [col['name'] for col in inspector.get_columns('roster')]
print(f"\nColumns in roster table:")
for col in sorted(columns):
print(f" - {col}")
print("=" * 60)
print("DEV database schema updated successfully!")
print("\nNote: SQLite doesn't support ALTER COLUMN, so existing")
print("columns won't be modified, but new columns will be added.")
if __name__ == "__main__":
update_schema()