diff options
| author | stilbruch <stilbruch@protonail.com> | 2022-03-23 19:08:05 -0500 |
|---|---|---|
| committer | stilbruch <stilbruch@protonail.com> | 2022-03-23 19:08:05 -0500 |
| commit | 5d74e9e1bb30e65dbd4d0528f7140b7813965841 (patch) | |
| tree | 5c482829ed7fba47917e86ed8a9faf20ba160f65 /app/tables | |
| parent | 695215c993765d910a31789d0a70eef5ee3b57e9 (diff) | |
| download | Strengthy-5d74e9e1bb30e65dbd4d0528f7140b7813965841.tar.xz Strengthy-5d74e9e1bb30e65dbd4d0528f7140b7813965841.zip | |
Add basic workout classes
Diffstat (limited to 'app/tables')
| -rw-r--r-- | app/tables/workout.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/tables/workout.py b/app/tables/workout.py new file mode 100644 index 0000000..f3a41eb --- /dev/null +++ b/app/tables/workout.py @@ -0,0 +1,19 @@ +from app import db, login_manager + +# Represents an individual exercise +class Exercise(db.Model) + __tablename__ = 'exercises' + id = db.Column(db.Integer, primary_key=True) + +# Represents a singular workout +class Workout(db.Model) + __tablename__ = 'workouts' + id = db.Column(db.Integer, primary_key=True) + user_id = db.Column(db.Integer, db.ForeignKey('user.id')) + +# Connects workouts to it's exercises +class WorkoutExercise(db.Model) + __table__ = 'workout_exercises' + id = db.Column(db.Integer, primary_key=True) + workout_id = db.Column(db.Integer, db.ForeignKey('workout.id')) + exercise_id = db.Column(db.Integer, db.ForeignKey('exercise.id')) |
