You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.2 KiB

Sequel.migration do
change do
create_table(:pools) do
primary_key :id
String :name, null: false
DateTime :created_at, null: false
DateTime :updated_at, null: false
end
create_table(:items) do
primary_key :id
foreign_key :pool_id, :pools
String :title, null: false
String :body, null: false
DateTime :created_at, null: false
DateTime :updated_at, null: false
end
create_table(:axes) do
primary_key :id
foreign_key :pool_id, :pools
String :name, null: false
String :better_legend, null: false
String :worse_legend, null: false
DateTime :created_at, null: false
DateTime :updated_at, null: false
end
create_table(:ratings) do
primary_key :id
foreign_key :axis_id, :axes
foreign_key :winner_id, :items
foreign_key :loser_id, :items
DateTime :created_at, null: false
DateTime :updated_at, null: false
end
create_table(:rankings) do
primary_key :id
foreign_key :axis_id, :axes
foreign_key :item_id, :items
Float :mu, null: false
Float :sigma, null: false
DateTime :created_at, null: false
DateTime :updated_at, null: false
end
end
end