20 lines
469 B
Ruby
20 lines
469 B
Ruby
Sequel.migration do
|
|
change do
|
|
create_table(:encounters) do
|
|
primary_key :id
|
|
|
|
Integer :percentage
|
|
TrueClass :static
|
|
String :location, null: false, index: true
|
|
|
|
foreign_key :pokemon_id, :pokemon, null: false, on_delete: :cascade
|
|
foreign_key :version_id, :versions, null: false, on_delete: :cascade
|
|
end
|
|
|
|
alter_table(:hunts) do
|
|
drop_column :pokemon_id
|
|
add_foreign_key :enounter_id, :encounters
|
|
end
|
|
end
|
|
end
|