about summary refs log tree commit diff stats
path: root/db/migrate
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-09-30 08:23:48 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-09-30 08:23:48 -0400
commita7060addea52af313ed85336dc37949ad8e69f05 (patch)
treee2a65669c9f30788c22635800180f5393c9ec49c /db/migrate
parent6dff23b065bd933ff2f571d2264c86902173d40b (diff)
downloadpokeviewer-a7060addea52af313ed85336dc37949ad8e69f05.tar.gz
pokeviewer-a7060addea52af313ed85336dc37949ad8e69f05.tar.bz2
pokeviewer-a7060addea52af313ed85336dc37949ad8e69f05.zip
Added gift ribbon descriptions
This is basically just for completeness because it is unknown whether
gift ribbons other than the National Ribbon and Earth Ribbon from
Pokémon Colosseum were ever distributed.
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20170929221317_create_pokeviewer_gift_ribbons.rb9
-rw-r--r--db/migrate/20170930021856_add_gift_ribbons_to_trainer.rb34
2 files changed, 43 insertions, 0 deletions
diff --git a/db/migrate/20170929221317_create_pokeviewer_gift_ribbons.rb b/db/migrate/20170929221317_create_pokeviewer_gift_ribbons.rb new file mode 100644 index 0000000..deedc80 --- /dev/null +++ b/db/migrate/20170929221317_create_pokeviewer_gift_ribbons.rb
@@ -0,0 +1,9 @@
1class CreatePokeviewerGiftRibbons < ActiveRecord::Migration[5.1]
2 def change
3 create_table :pokeviewer_gift_ribbons do |t|
4 t.string :description, null: false
5
6 t.timestamps
7 end
8 end
9end
diff --git a/db/migrate/20170930021856_add_gift_ribbons_to_trainer.rb b/db/migrate/20170930021856_add_gift_ribbons_to_trainer.rb new file mode 100644 index 0000000..2a5f9b3 --- /dev/null +++ b/db/migrate/20170930021856_add_gift_ribbons_to_trainer.rb
@@ -0,0 +1,34 @@
1class AddGiftRibbonsToTrainer < ActiveRecord::Migration[5.1]
2 def change
3 change_table :pokeviewer_trainers do |t|
4 t.references :marine_ribbon, null: true
5 t.references :land_ribbon, null: true
6 t.references :sky_ribbon, null: true
7 t.references :country_ribbon, null: true
8 t.references :national_ribbon, null: true
9 t.references :earth_ribbon, null: true
10 t.references :world_ribbon, null: true
11 end
12
13 add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons,
14 column: :marine_ribbon_id
15
16 add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons,
17 column: :land_ribbon_id
18
19 add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons,
20 column: :sky_ribbon_id
21
22 add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons,
23 column: :country_ribbon_id
24
25 add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons,
26 column: :national_ribbon_id
27
28 add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons,
29 column: :earth_ribbon_id
30
31 add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons,
32 column: :world_ribbon_id
33 end
34end