feat: replace wk1/wk4 targets with 6→8→10→12 rep ladder progression
Simplifies the progression model to a universal rep ladder: every exercise follows 6→8→10→12 reps at current weight, then +5 lbs and reset to 6. Replaces per-user wk1/wk4 rep and weight targets with a single starting_weight field. - Add Alembic migration to drop wk1_reps/wk4_reps/wk1_weight/wk4_weight, add starting_weight (migrated from wk1_weight) - Run Alembic migrations on app startup instead of create_all, with auto-detection and stamping for legacy databases - Include alembic/ and alembic.ini in Docker image - Rewrite progression_service.get_suggestion() with ladder logic: climb, hold, weight_increase, hold_at_top, deload - Replace wk1/wk4 grid in exercise cards with rep ladder progress bar - Add color-coded progression badges by type - Change weight log input from text to number with pre-filled suggestion - Normalize weight input in routes (0→BW, bare number→N lbs) - Remove schedule page (route, template, nav link, tests) - Simplify user_programs.yaml from 4 fields to 1 per exercise - Update all tests for new schema and progression logic Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
45
alembic/versions/b2c3d4e5f6g7_simplify_to_starting_weight.py
Normal file
45
alembic/versions/b2c3d4e5f6g7_simplify_to_starting_weight.py
Normal file
@@ -0,0 +1,45 @@
|
||||
"""simplify user_exercise_programs to starting_weight
|
||||
|
||||
Revision ID: b2c3d4e5f6g7
|
||||
Revises: a1b2c3d4e5f6
|
||||
Create Date: 2026-03-13
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'b2c3d4e5f6g7'
|
||||
down_revision: Union[str, Sequence[str], None] = 'a1b2c3d4e5f6'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
with op.batch_alter_table('user_exercise_programs') as batch_op:
|
||||
batch_op.add_column(sa.Column('starting_weight', sa.String(), nullable=False, server_default=''))
|
||||
|
||||
op.execute("UPDATE user_exercise_programs SET starting_weight = wk1_weight")
|
||||
|
||||
with op.batch_alter_table('user_exercise_programs') as batch_op:
|
||||
batch_op.drop_column('wk1_reps')
|
||||
batch_op.drop_column('wk4_reps')
|
||||
batch_op.drop_column('wk1_weight')
|
||||
batch_op.drop_column('wk4_weight')
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
with op.batch_alter_table('user_exercise_programs') as batch_op:
|
||||
batch_op.add_column(sa.Column('wk1_reps', sa.String(), server_default=''))
|
||||
batch_op.add_column(sa.Column('wk4_reps', sa.String(), server_default=''))
|
||||
batch_op.add_column(sa.Column('wk1_weight', sa.String(), server_default=''))
|
||||
batch_op.add_column(sa.Column('wk4_weight', sa.String(), server_default=''))
|
||||
|
||||
op.execute("UPDATE user_exercise_programs SET wk1_weight = starting_weight")
|
||||
|
||||
with op.batch_alter_table('user_exercise_programs') as batch_op:
|
||||
batch_op.drop_column('starting_weight')
|
||||
Reference in New Issue
Block a user