[Issue #5] - Reworked app to better organize results with their corresponding tests

This commit is contained in:
2023-09-21 20:41:25 -06:00
parent 269587e6c9
commit c940a248d7
16 changed files with 266 additions and 7 deletions

View File

@ -0,0 +1,31 @@
Sequel.migration do
up do
# create tests table
create_table(:tests) do
primary_key :id
String :date_tag, null: false
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
end
# add foreign keys to tests table
alter_table(:tests) do
add_foreign_key(:benchmark_id, :benchmarks, null: false)
add_foreign_key(:hardware_id, :hardware, null: false)
end
# add the test ID link to results table; remove old links to hardware and benchmarks tables
alter_table(:results) do
add_foreign_key(:test_id, :tests, null: false)
drop_column(:benchmark_id)
drop_column(:hardware_id)
end
end
down do
drop_column(:results, :test_id)
drop_table(:tests)
end
end