Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Closes #487] Feature/move trial data to benchmark #488

Merged
merged 19 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
75c84fc
WIP: Start work moving trial data to benchmarks
canjalal Jan 10, 2025
5cdd9eb
addTrialData should update benchmark and not task_id
canjalal Jan 10, 2025
628a8e2
Restore getBenchmarkAndTrialData to also grab task, at least temporarily
canjalal Jan 10, 2025
08ef34a
temporarily revert benchmark_id to task_id for review.tsx
canjalal Jan 10, 2025
fe82ce4
temporarily revert benchmark_id to task_id for review.tsx
canjalal Jan 10, 2025
9dd7b5f
WIP: Separate out tasks and benchmarks, add migration to move due_dat…
canjalal Jan 17, 2025
746ed0e
WIP: Fix two more frontend page router pages
canjalal Jan 17, 2025
f8d9e45
remove due_date and trial_count from iep trpc methods, add updateBenc…
canjalal Jan 17, 2025
4d75ea1
Merge branch 'main' into feature/move-trial-data-to-benchmark
francisli Jan 24, 2025
7128456
Fix getMyTasks test for new schema
francisli Jan 24, 2025
ab9ba5a
Fix iep benchmark test
francisli Jan 24, 2025
34251a2
Fix type:check errors
francisli Jan 24, 2025
596d189
Fix BenchmarkAssignmentModal, add comments on next steps
francisli Jan 24, 2025
136b9c3
Update assignTasks implementation
francisli Jan 24, 2025
8ac4c6b
Update BenchmarkListElement to show current task assignment status
francisli Feb 5, 2025
0204132
WIP: Have paras updated in modal, still need to update BenchmarkAssig…
canjalal Feb 5, 2025
5b6aaa2
Fix due_date/trial_count null value set
francisli Feb 15, 2025
dd6e71d
Work in progress, update benchmark and propagate data back
francisli Feb 15, 2025
3fe25ec
Complete full edit functionality in benchmark assignment modal
francisli Feb 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions src/backend/db/migrations/5_trial_data_belongs_to_benchmark.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
-- Step 1: Add new benchmark_id column to trial_data
ALTER TABLE trial_data
ADD COLUMN benchmark_id uuid REFERENCES benchmark(benchmark_id);

-- Step 1a: Add due_date and trial_count to benchmark

ALTER TABLE benchmark
ADD COLUMN due_date TIMESTAMPTZ;

ALTER TABLE benchmark
ADD COLUMN trial_count INTEGER;

-- Step 2: Copy benchmark_id from tasks for existing records
UPDATE trial_data
SET benchmark_id = task.benchmark_id
FROM task
WHERE trial_data.task_id = task.task_id;

-- Step 2a: Copy due_date and trial_count from tasks for existing records
-- Taking the first result of tasks that matches the right benchmark_id

UPDATE benchmark
SET due_date = task.due_date, trial_count = task.trial_count
FROM task
WHERE task.benchmark_id = benchmark.benchmark_id;

-- Step 3: Make benchmark_id required
ALTER TABLE trial_data
ALTER COLUMN benchmark_id SET NOT NULL;

-- Step 4: Remove task_id column
ALTER TABLE trial_data
DROP COLUMN task_id;

-- Step 4a: Remove due_date, and trial_count from task

ALTER TABLE task
DROP COLUMN due_date;

ALTER TABLE task
DROP COLUMN trial_count;
Loading