import sys import os # Ensure we can import from app sys.path.append(os.getcwd()) from app.database import engine, Base # Import models to ensure they are registered with Base from app.models import Job, Step, JobLog def init_db(): print("Creating database tables...") try: Base.metadata.create_all(bind=engine) print("Tables created successfully!") except Exception as e: print(f"Error creating tables: {e}") if __name__ == "__main__": init_db()