-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Start work moving trial data to benchmarks
- Loading branch information
Showing
3 changed files
with
24 additions
and
11 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/backend/db/migrations/5_trial_data_belongs_to_benchmark.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- Step 1: Add new benchmark_id column to trial_data | ||
ALTER TABLE trial_data | ||
ADD COLUMN benchmark_id uuid REFERENCES benchmark(benchmark_id); | ||
|
||
-- 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 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters