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
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -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
|
||||
|
@ -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
|
Reference in New Issue
Block a user