blob: 3c24c1b04b11c99b2ff7080fc0e8604a30733d20 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
class AddTypeAndAbilityToSpecies < ActiveRecord::Migration[5.1]
def change
change_table :pokeviewer_species do |t|
t.string :type_1, null: false, default: ""
t.string :type_2
t.references :ability_1, null: false, default: 0
t.references :ability_2
end
change_column_default :pokeviewer_species, :type_1, nil
change_column_default :pokeviewer_species, :ability_1_id, nil
add_foreign_key :pokeviewer_species, :pokeviewer_abilities,
column: :ability_1_id
add_foreign_key :pokeviewer_species, :pokeviewer_abilities,
column: :ability_2_id
end
end
|