From 100270703f06e7fa1f12ee8bb6aee297c56ce49b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 29 Jan 2018 21:20:46 -0500 Subject: Updated pokeviewer (Pokédex) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile.lock | 18 +++++++++--------- ..._create_pokeviewer_pokedex_entries.pokeviewer.rb | 21 +++++++++++++++++++++ db/schema.rb | 15 ++++++++++++++- 3 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 db/migrate/20180130021851_create_pokeviewer_pokedex_entries.pokeviewer.rb diff --git a/Gemfile.lock b/Gemfile.lock index db45fb3..c3b8b10 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/hatkirby/pokeviewer.git - revision: 30cd66e1521bc760df45908adb2f7d3ba6683900 + revision: 8d548aef82436ab20b1fe6dd6f6e39d1cbca6119 specs: pokeviewer (0.1.0) activerecord-diff @@ -63,7 +63,7 @@ GEM bcrypt (3.1.11) bindex (0.5.0) builder (3.2.3) - byebug (9.1.0) + byebug (10.0.0) capistrano (3.10.1) airbrussh (>= 1.0.0) i18n @@ -104,7 +104,7 @@ GEM coffee-script-source (1.12.2) concurrent-ruby (1.0.5) crass (1.0.3) - devise (4.4.0) + devise (4.4.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0, < 5.2) @@ -121,7 +121,7 @@ GEM temple (>= 0.8.0) tilt highline (1.7.10) - i18n (0.9.1) + i18n (0.9.3) concurrent-ruby (~> 1.0) jbuilder (2.7.0) activesupport (>= 4.2.0) @@ -147,25 +147,25 @@ GEM mimemagic (0.3.2) mini_mime (1.0.0) mini_portile2 (2.3.0) - minitest (5.11.1) + minitest (5.11.3) multi_json (1.13.1) mysql2 (0.4.10) net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (4.2.0) nio4r (2.2.0) - nokogiri (1.8.1) + nokogiri (1.8.2) mini_portile2 (~> 2.3.0) normalize-rails (4.1.1) orm_adapter (0.5.0) - paperclip (5.1.0) + paperclip (5.2.1) activemodel (>= 4.2.0) activesupport (>= 4.2.0) cocaine (~> 0.5.5) mime-types mimemagic (~> 0.3.0) public_suffix (3.0.1) - puma (3.11.0) + puma (3.11.2) rack (2.0.3) rack-test (0.8.2) rack (>= 1.0, < 3) @@ -247,7 +247,7 @@ GEM turbolinks-source (5.1.0) tzinfo (1.2.4) thread_safe (~> 0.1) - uglifier (4.1.3) + uglifier (4.1.5) execjs (>= 0.3.0, < 3) victor (0.2.1) warden (1.2.7) diff --git a/db/migrate/20180130021851_create_pokeviewer_pokedex_entries.pokeviewer.rb b/db/migrate/20180130021851_create_pokeviewer_pokedex_entries.pokeviewer.rb new file mode 100644 index 0000000..2451ef2 --- /dev/null +++ b/db/migrate/20180130021851_create_pokeviewer_pokedex_entries.pokeviewer.rb @@ -0,0 +1,21 @@ +# This migration comes from pokeviewer (originally 20180129213822) +class CreatePokeviewerPokedexEntries < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_pokedex_entries do |t| + t.references :trainer, null: true + t.references :species, null: true + t.boolean :caught, null: true, default: false + + t.timestamps + end + + add_foreign_key :pokeviewer_pokedex_entries, :pokeviewer_trainers, + column: :trainer_id + + add_foreign_key :pokeviewer_pokedex_entries, :pokeviewer_species, + column: :species_id + + add_index :pokeviewer_pokedex_entries, [:trainer_id, :species_id], + unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index f4243a4..868f6f6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180114181813) do +ActiveRecord::Schema.define(version: 20180130021851) do create_table "ckeditor_assets", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| t.string "data_file_name", null: false @@ -78,6 +78,17 @@ ActiveRecord::Schema.define(version: 20180114181813) do t.index ["name"], name: "index_pokeviewer_moves_on_name", unique: true end + create_table "pokeviewer_pokedex_entries", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| + t.bigint "trainer_id" + t.bigint "species_id" + t.boolean "caught", default: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["species_id"], name: "index_pokeviewer_pokedex_entries_on_species_id" + t.index ["trainer_id", "species_id"], name: "index_pokeviewer_pokedex_entries_on_trainer_id_and_species_id", unique: true + t.index ["trainer_id"], name: "index_pokeviewer_pokedex_entries_on_trainer_id" + end + create_table "pokeviewer_pokemon", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| t.string "uuid", null: false t.integer "trainer_id" @@ -239,6 +250,8 @@ ActiveRecord::Schema.define(version: 20180114181813) do t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end + add_foreign_key "pokeviewer_pokedex_entries", "pokeviewer_species", column: "species_id" + add_foreign_key "pokeviewer_pokedex_entries", "pokeviewer_trainers", column: "trainer_id" add_foreign_key "pokeviewer_pokemon", "pokeviewer_revisions", column: "current_id" add_foreign_key "pokeviewer_revisions", "pokeviewer_species", column: "species_id" end -- cgit 1.4.1