diff options
Diffstat (limited to 'db/migrate/20180114170238_cache_current_pokemon_revision.rb')
-rw-r--r-- | db/migrate/20180114170238_cache_current_pokemon_revision.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/db/migrate/20180114170238_cache_current_pokemon_revision.rb b/db/migrate/20180114170238_cache_current_pokemon_revision.rb index a0e1747..8b1d6ff 100644 --- a/db/migrate/20180114170238_cache_current_pokemon_revision.rb +++ b/db/migrate/20180114170238_cache_current_pokemon_revision.rb | |||
@@ -1,10 +1,10 @@ | |||
1 | class CacheCurrentPokemonRevision < ActiveRecord::Migration[5.1] | 1 | class CacheCurrentPokemonRevision < ActiveRecord::Migration[5.1] |
2 | def up | 2 | def up |
3 | change_table :pokeviewer_pokemon do |t| | 3 | change_table :pokemon do |t| |
4 | t.references :current, null: true | 4 | t.references :current, null: true |
5 | end | 5 | end |
6 | 6 | ||
7 | add_foreign_key :pokeviewer_pokemon, :pokeviewer_revisions, | 7 | add_foreign_key :pokemon, :revisions, |
8 | column: :current_id | 8 | column: :current_id |
9 | 9 | ||
10 | Pokeviewer::Pokemon.all.each do |p| | 10 | Pokeviewer::Pokemon.all.each do |p| |
@@ -14,6 +14,6 @@ class CacheCurrentPokemonRevision < ActiveRecord::Migration[5.1] | |||
14 | end | 14 | end |
15 | 15 | ||
16 | def down | 16 | def down |
17 | remove_column :pokeviewer_pokemon, :current_id | 17 | remove_column :pokemon, :current_id |
18 | end | 18 | end |
19 | end | 19 | end |