diff --git a/backend/app.py b/backend/app.py index 4bc3a8c..899d565 100644 --- a/backend/app.py +++ b/backend/app.py @@ -82,6 +82,10 @@ HoleScore.round = relationship("Round", back_populates="hole_scores") HoleScore.putts = relationship("Putt", back_populates="hole_score") Putt.hole_score = relationship("HoleScore", back_populates="putts") +# Recreate DB for prototype if schema changed +if os.path.exists("backend/golf.db"): + os.remove("backend/golf.db") + Base.metadata.create_all(bind=engine) app = FastAPI()