from sqlmodel import Session, select from database import engine from models import SubCategory with Session(engine) as session: subcat = session.exec(select(SubCategory).where(SubCategory.name == "שכר עבודה 1")).first() if subcat: print("Found:", subcat.name, "ID:", subcat.id) session.delete(subcat) session.commit() print("Deleted!") else: print("No subcategory found with that name.")