about summary refs log tree commit diff stats
path: root/db/migrate/20180113200119_move_species_to_revision.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20180113200119_move_species_to_revision.rb')
-rw-r--r--db/migrate/20180113200119_move_species_to_revision.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/db/migrate/20180113200119_move_species_to_revision.rb b/db/migrate/20180113200119_move_species_to_revision.rb index 8b94d48..9f84c51 100644 --- a/db/migrate/20180113200119_move_species_to_revision.rb +++ b/db/migrate/20180113200119_move_species_to_revision.rb
@@ -1,6 +1,6 @@
1class MoveSpeciesToRevision < ActiveRecord::Migration[5.1] 1class MoveSpeciesToRevision < ActiveRecord::Migration[5.1]
2 def up 2 def up
3 change_table :pokeviewer_revisions do |t| 3 change_table :revisions do |t|
4 t.references :species, null: true 4 t.references :species, null: true
5 end 5 end
6 6
@@ -9,17 +9,17 @@ class MoveSpeciesToRevision < ActiveRecord::Migration[5.1]
9 r.save! 9 r.save!
10 end 10 end
11 11
12 remove_column :pokeviewer_pokemon, :species_id 12 remove_column :pokemon, :species_id
13 13
14 change_column_null :pokeviewer_revisions, :species_id, false 14 change_column_null :revisions, :species_id, false
15 15
16 add_foreign_key :pokeviewer_revisions, :pokeviewer_species, 16 add_foreign_key :revisions, :species,
17 column: :species_id 17 column: :species_id
18 end 18 end
19 19
20 def down 20 def down
21 def up 21 def up
22 change_table :pokeviewer_pokemon do |t| 22 change_table :pokemon do |t|
23 t.references :species, null: true 23 t.references :species, null: true
24 end 24 end
25 25
@@ -28,11 +28,11 @@ class MoveSpeciesToRevision < ActiveRecord::Migration[5.1]
28 p.save! 28 p.save!
29 end 29 end
30 30
31 remove_column :pokeviewer_revisions, :species_id 31 remove_column :revisions, :species_id
32 32
33 change_column_null :pokeviewer_pokemon, :species_id, false 33 change_column_null :pokemon, :species_id, false
34 34
35 add_foreign_key :pokeviewer_pokemon, :pokeviewer_species, 35 add_foreign_key :pokemon, :species,
36 column: :species_id 36 column: :species_id
37 end 37 end
38 end 38 end