Removed Test object to simplify database schema; updated docker scripts to run database migrations before starting the server if the database doesn't exist
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2024-02-09 08:40:34 -05:00
parent c83d517437
commit ef2e0a12a5
17 changed files with 17 additions and 274 deletions

View File

@ -4,6 +4,7 @@ Sequel.migration do
# create tests table
create_table(:results) do
primary_key :id
foreign_key :hardware_id, :hardware
foreign_key :benchmark_id, :benchmarks
Float :avg_score, null: false
Float :min_score
@ -11,18 +12,9 @@ Sequel.migration do
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
end
# create many-to-many table for results and tests
create_table(:tests_results) do
foreign_key :test_id, :tests
foreign_key :result_id, :results
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
end
end
down do
drop_table(:tests_results)
drop_table(:results)
end

View File

@ -1,28 +0,0 @@
Sequel.migration do
up do
# create tests table
create_table(:tests) do
primary_key :id
foreign_key :hardware_id, :hardware
String :date_tag, null: false
String :description, text: true
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
end
# create many-to-many table for benchmarks and tests
create_table(:tests_benchmarks) do
foreign_key :test_id, :tests
foreign_key :benchmark_id, :benchmarks
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
end
end
down do
drop_table(:tests_benchmarks)
drop_table(:tests)
end
end