Reworked database schema from scratch
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user