Reworked database schema from scratch

This commit is contained in:
2023-12-07 12:59:32 -05:00
parent 394a8ef91f
commit b819f4f1cd
5 changed files with 59 additions and 61 deletions

View File

@ -5,6 +5,7 @@ Sequel.migration do
primary_key :id
String :name, null: false
String :type, null: false
String :description, text: true
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
end
@ -12,28 +13,16 @@ Sequel.migration do
create_table(:benchmarks) do
primary_key :id
String :name, null: false
String :description
String :description, text: true
String :scoring, null: false
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
end
create_table(:results) do
primary_key :id
String :score, null: false
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
end
alter_table(:results) do
add_foreign_key :hardware_id, :hardware
add_foreign_key :benchmark_id, :benchmarks
end
end
down do
drop_table(:hardware)
drop_table(:benchmarks)
drop_table(:results)
end
end