diff --git a/internal/database/migrations/000005_rename_workout_load.down.sql b/internal/database/migrations/000005_rename_workout_load.down.sql new file mode 100644 index 0000000..4f21adb --- /dev/null +++ b/internal/database/migrations/000005_rename_workout_load.down.sql @@ -0,0 +1,10 @@ +BEGIN; + +ALTER TABLE exercises DROP CONSTRAINT exercises_load_check; + +UPDATE exercises SET load = 'absolute' WHERE load = 'external'; + +ALTER TABLE exercises ADD CONSTRAINT exercises_load_check + CHECK (load IN ('bodyweight', 'absolute')); + +COMMIT; diff --git a/internal/database/migrations/000005_rename_workout_load.up.sql b/internal/database/migrations/000005_rename_workout_load.up.sql new file mode 100644 index 0000000..75fbf28 --- /dev/null +++ b/internal/database/migrations/000005_rename_workout_load.up.sql @@ -0,0 +1,10 @@ +BEGIN; + +ALTER TABLE exercises DROP CONSTRAINT exercises_load_check; + +UPDATE exercises SET load = 'external' WHERE load = 'absolute'; + +ALTER TABLE exercises ADD CONSTRAINT exercises_load_check + CHECK (load IN ('bodyweight', 'external')); + +COMMIT;