From 9d6d876c62408c69c654aab1a664f1294ec668b7 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 15 Oct 2017 13:49:03 -0400 Subject: Added pokeviewer --- Gemfile | 3 +- Gemfile.lock | 171 ++++++++++++-------- app/controllers/application_controller.rb | 10 ++ app/models/user.rb | 2 + config/routes.rb | 2 + .../20171015171142_add_pokeviewer_token_to_user.rb | 9 ++ ...171539_create_pokeviewer_trainers.pokeviewer.rb | 14 ++ ...5171540_create_pokeviewer_species.pokeviewer.rb | 12 ++ ...5171541_create_pokeviewer_pokemon.pokeviewer.rb | 32 ++++ ...015171542_create_pokeviewer_moves.pokeviewer.rb | 13 ++ ...71543_create_pokeviewer_revisions.pokeviewer.rb | 52 ++++++ ...015171544_make_met_level_nullable.pokeviewer.rb | 6 + ...15171545_add_ot_gender_to_pokemon.pokeviewer.rb | 6 + ...71546_add_storage_info_to_pokemon.pokeviewer.rb | 7 + ...015171547_create_pokeviewer_boxes.pokeviewer.rb | 16 ++ ...71548_create_pokeviewer_locations.pokeviewer.rb | 10 ++ ...015171549_add_ribbons_to_revision.pokeviewer.rb | 25 +++ ...50_create_pokeviewer_gift_ribbons.pokeviewer.rb | 10 ++ ...71551_add_gift_ribbons_to_trainer.pokeviewer.rb | 35 ++++ ...015171552_create_pokeviewer_items.pokeviewer.rb | 17 ++ ...add_description_and_type_to_moves.pokeviewer.rb | 15 ++ ...5171554_rename_revision_hold_item.pokeviewer.rb | 10 ++ ...71555_rename_pokemon_met_location.pokeviewer.rb | 31 ++++ .../20171015171556_remove_boxes.pokeviewer.rb | 107 +++++++++++++ ...015171557_add_pokeball_to_pokemon.pokeviewer.rb | 10 ++ ...71558_create_pokeviewer_abilities.pokeviewer.rb | 13 ++ ...9_add_type_and_ability_to_species.pokeviewer.rb | 20 +++ db/schema.rb | 177 ++++++++++++++++++++- db/seeds.rb | 1 + 29 files changed, 764 insertions(+), 72 deletions(-) create mode 100644 db/migrate/20171015171142_add_pokeviewer_token_to_user.rb create mode 100644 db/migrate/20171015171539_create_pokeviewer_trainers.pokeviewer.rb create mode 100644 db/migrate/20171015171540_create_pokeviewer_species.pokeviewer.rb create mode 100644 db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb create mode 100644 db/migrate/20171015171542_create_pokeviewer_moves.pokeviewer.rb create mode 100644 db/migrate/20171015171543_create_pokeviewer_revisions.pokeviewer.rb create mode 100644 db/migrate/20171015171544_make_met_level_nullable.pokeviewer.rb create mode 100644 db/migrate/20171015171545_add_ot_gender_to_pokemon.pokeviewer.rb create mode 100644 db/migrate/20171015171546_add_storage_info_to_pokemon.pokeviewer.rb create mode 100644 db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb create mode 100644 db/migrate/20171015171548_create_pokeviewer_locations.pokeviewer.rb create mode 100644 db/migrate/20171015171549_add_ribbons_to_revision.pokeviewer.rb create mode 100644 db/migrate/20171015171550_create_pokeviewer_gift_ribbons.pokeviewer.rb create mode 100644 db/migrate/20171015171551_add_gift_ribbons_to_trainer.pokeviewer.rb create mode 100644 db/migrate/20171015171552_create_pokeviewer_items.pokeviewer.rb create mode 100644 db/migrate/20171015171553_add_description_and_type_to_moves.pokeviewer.rb create mode 100644 db/migrate/20171015171554_rename_revision_hold_item.pokeviewer.rb create mode 100644 db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb create mode 100644 db/migrate/20171015171556_remove_boxes.pokeviewer.rb create mode 100644 db/migrate/20171015171557_add_pokeball_to_pokemon.pokeviewer.rb create mode 100644 db/migrate/20171015171558_create_pokeviewer_abilities.pokeviewer.rb create mode 100644 db/migrate/20171015171559_add_type_and_ability_to_species.pokeviewer.rb diff --git a/Gemfile b/Gemfile index 869e0f5..aee427f 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 5.1.1' +gem 'rails', '~> 5.1.4' # Use sqlite3 as the database for Active Record gem 'sqlite3' # Use Puma as the app server @@ -68,3 +68,4 @@ gem 'devise' gem 'ckeditor' gem 'paperclip' gem 'jquery-rails' +gem 'pokeviewer', github: "hatkirby/pokeviewer" diff --git a/Gemfile.lock b/Gemfile.lock index 66508c8..be2a865 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,76 +1,93 @@ +GIT + remote: https://github.com/hatkirby/pokeviewer.git + revision: b166b618d2f5e47d1755be55902a176555395de7 + specs: + pokeviewer (0.1.0) + activerecord-diff + coffee-rails (~> 4.2) + enumerize + haml + jquery-rails + normalize-rails + rails (~> 5.1.4) + sass-rails (~> 5.0) + sequenced + victor + GEM remote: https://rubygems.org/ specs: - actioncable (5.1.1) - actionpack (= 5.1.1) + actioncable (5.1.4) + actionpack (= 5.1.4) nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.1.1) - actionpack (= 5.1.1) - actionview (= 5.1.1) - activejob (= 5.1.1) + actionmailer (5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.1.1) - actionview (= 5.1.1) - activesupport (= 5.1.1) + actionpack (5.1.4) + actionview (= 5.1.4) + activesupport (= 5.1.4) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.1) - activesupport (= 5.1.1) + actionview (5.1.4) + activesupport (= 5.1.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.1) - activesupport (= 5.1.1) + activejob (5.1.4) + activesupport (= 5.1.4) globalid (>= 0.3.6) - activemodel (5.1.1) - activesupport (= 5.1.1) - activerecord (5.1.1) - activemodel (= 5.1.1) - activesupport (= 5.1.1) + activemodel (5.1.4) + activesupport (= 5.1.4) + activerecord (5.1.4) + activemodel (= 5.1.4) + activesupport (= 5.1.4) arel (~> 8.0) - activesupport (5.1.1) + activerecord-diff (2.0.0) + activesupport (5.1.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) - airbrussh (1.2.0) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + airbrussh (1.3.0) sshkit (>= 1.6.1, != 1.7.0) arel (8.0.0) bcrypt (3.1.11) bindex (0.5.0) builder (3.2.3) - byebug (9.0.6) - capistrano (3.8.1) + byebug (9.1.0) + capistrano (3.9.1) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) sshkit (>= 1.9.0) - capistrano-bundler (1.2.0) + capistrano-bundler (1.3.0) capistrano (~> 3.1) sshkit (~> 1.2) capistrano-passenger (0.2.0) capistrano (~> 3.0) - capistrano-rails (1.2.3) + capistrano-rails (1.3.0) capistrano (~> 3.1) capistrano-bundler (~> 1.1) capistrano-rvm (0.1.2) capistrano (~> 3.0) sshkit (~> 1.2) - capybara (2.14.3) + capybara (2.15.4) addressable - mime-types (>= 1.16) + mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - childprocess (0.7.0) + childprocess (0.8.0) ffi (~> 1.0, >= 1.0.11) ckeditor (4.2.4) cocaine @@ -86,22 +103,25 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.0.5) + crass (1.0.2) devise (4.3.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0, < 5.2) responders warden (~> 1.2.3) - erubi (1.6.0) + enumerize (2.1.2) + activesupport (>= 3.2) + erubi (1.7.0) execjs (2.7.0) ffi (1.9.18) globalid (0.4.0) activesupport (>= 4.2.0) - haml (5.0.1) + haml (5.0.4) temple (>= 0.8.0) tilt highline (1.7.8) - i18n (0.8.4) + i18n (0.8.6) jbuilder (2.7.0) activesupport (>= 4.2.0) multi_json (>= 1.2) @@ -109,30 +129,32 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - libv8 (3.16.14.19-x86_64-darwin-16) + libv8 (3.16.14.19) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - loofah (2.0.3) + loofah (2.1.1) + crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.6.6) mime-types (>= 1.16, < 4) - method_source (0.8.2) + method_source (0.9.0) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mimemagic (0.3.2) - mini_portile2 (2.2.0) - minitest (5.10.2) - multi_json (1.12.1) - mysql2 (0.4.6) + mini_mime (0.1.4) + mini_portile2 (2.3.0) + minitest (5.10.3) + multi_json (1.12.2) + mysql2 (0.4.9) net-scp (1.2.1) net-ssh (>= 2.6.5) - net-ssh (4.1.0) + net-ssh (4.2.0) nio4r (2.1.0) - nokogiri (1.8.0) - mini_portile2 (~> 2.2.0) + nokogiri (1.8.1) + mini_portile2 (~> 2.3.0) normalize-rails (4.1.1) orm_adapter (0.5.0) paperclip (5.1.0) @@ -141,36 +163,36 @@ GEM cocaine (~> 0.5.5) mime-types mimemagic (~> 0.3.0) - public_suffix (2.0.5) - puma (3.9.1) + public_suffix (3.0.0) + puma (3.10.0) rack (2.0.3) - rack-test (0.6.3) - rack (>= 1.0) - rails (5.1.1) - actioncable (= 5.1.1) - actionmailer (= 5.1.1) - actionpack (= 5.1.1) - actionview (= 5.1.1) - activejob (= 5.1.1) - activemodel (= 5.1.1) - activerecord (= 5.1.1) - activesupport (= 5.1.1) - bundler (>= 1.3.0, < 2.0) - railties (= 5.1.1) + rack-test (0.7.0) + rack (>= 1.0, < 3) + rails (5.1.4) + actioncable (= 5.1.4) + actionmailer (= 5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) + activemodel (= 5.1.4) + activerecord (= 5.1.4) + activesupport (= 5.1.4) + bundler (>= 1.3.0) + railties (= 5.1.4) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - railties (5.1.1) - actionpack (= 5.1.1) - activesupport (= 5.1.1) + railties (5.1.4) + actionpack (= 5.1.4) + activesupport (= 5.1.4) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (12.0.0) - rb-fsevent (0.9.8) + rake (12.1.0) + rb-fsevent (0.10.2) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) ref (2.0.0) @@ -179,16 +201,23 @@ GEM railties (>= 4.2.0, < 5.3) ruby_dep (1.5.0) rubyzip (1.2.1) - sass (3.4.24) + sass (3.5.2) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - selenium-webdriver (3.4.3) + selenium-webdriver (3.6.0) childprocess (~> 0.5) rubyzip (~> 1.0) + sequenced (3.1.1) + activerecord (>= 3.0) + activesupport (>= 3.0) spring (2.0.2) activesupport (>= 4.2) spring-watcher-listen (2.0.1) @@ -197,21 +226,21 @@ GEM sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.0) + sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.3.13) - sshkit (1.13.1) + sshkit (1.14.0) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) temple (0.8.0) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref - thor (0.19.4) + thor (0.20.0) thread_safe (0.3.6) - tilt (2.0.7) + tilt (2.0.8) turbolinks (5.0.1) turbolinks-source (~> 5) turbolinks-source (5.0.3) @@ -219,6 +248,7 @@ GEM thread_safe (~> 0.1) uglifier (3.2.0) execjs (>= 0.3.0, < 3) + victor (0.2.1) warden (1.2.7) rack (>= 1.0) web-console (3.5.1) @@ -254,8 +284,9 @@ DEPENDENCIES mysql2 normalize-rails paperclip + pokeviewer! puma (~> 3.7) - rails (~> 5.1.1) + rails (~> 5.1.4) sass-rails (~> 5.0) selenium-webdriver spring diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0174cae..c9d4e15 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,6 +1,16 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception + protected + + def authenticate_pokeviewer(login, token) + user = login && User.find_by_login(login) + + ActiveSupport::SecurityUtils.secure_compare( + ::Digest::SHA256.hexdigest(user.pokeviewer_token), + ::Digest::SHA256.hexdigest(token)) + end + private def after_sign_out_path_for(resource) diff --git a/app/models/user.rb b/app/models/user.rb index b8bdae1..555729a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,4 +3,6 @@ class User < ApplicationRecord # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable + + has_secure_token :pokeviewer_token end diff --git a/config/routes.rb b/config/routes.rb index 1003a8b..1216b85 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -15,4 +15,6 @@ Rails.application.routes.draw do root "records#index" get 'says/:slug', to: 'entries#show' + + mount Pokeviewer::Engine => '/poke3' end diff --git a/db/migrate/20171015171142_add_pokeviewer_token_to_user.rb b/db/migrate/20171015171142_add_pokeviewer_token_to_user.rb new file mode 100644 index 0000000..2dc5143 --- /dev/null +++ b/db/migrate/20171015171142_add_pokeviewer_token_to_user.rb @@ -0,0 +1,9 @@ +class AddPokeviewerTokenToUser < ActiveRecord::Migration[5.1] + def change + change_table :users do |t| + t.string :pokeviewer_token, limit: 191 + end + + add_index :users, :pokeviewer_token, unique: true + end +end diff --git a/db/migrate/20171015171539_create_pokeviewer_trainers.pokeviewer.rb b/db/migrate/20171015171539_create_pokeviewer_trainers.pokeviewer.rb new file mode 100644 index 0000000..396bcea --- /dev/null +++ b/db/migrate/20171015171539_create_pokeviewer_trainers.pokeviewer.rb @@ -0,0 +1,14 @@ +# This migration comes from pokeviewer (originally 20170916225306) +class CreatePokeviewerTrainers < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_trainers do |t| + t.string :game, null: false + t.string :name, null: false, limit: 191 + t.integer :number, null: false + + t.timestamps + end + + add_index :pokeviewer_trainers, [:name, :number], unique: true + end +end diff --git a/db/migrate/20171015171540_create_pokeviewer_species.pokeviewer.rb b/db/migrate/20171015171540_create_pokeviewer_species.pokeviewer.rb new file mode 100644 index 0000000..d3e299f --- /dev/null +++ b/db/migrate/20171015171540_create_pokeviewer_species.pokeviewer.rb @@ -0,0 +1,12 @@ +# This migration comes from pokeviewer (originally 20170916232015) +class CreatePokeviewerSpecies < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_species do |t| + t.string :name, null: false, limit: 191 + + t.timestamps + end + + add_index :pokeviewer_species, :name, unique: true + end +end diff --git a/db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb b/db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb new file mode 100644 index 0000000..dd14d8c --- /dev/null +++ b/db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb @@ -0,0 +1,32 @@ +# This migration comes from pokeviewer (originally 20170916234251) +class CreatePokeviewerPokemon < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_pokemon do |t| + t.string :uuid, null: false, limit: 191 + t.references :species, null: false + t.references :trainer, null: true + t.string :key, null: true, limit: 191 + t.string :ot_name, null: false + t.integer :ot_number, null: false + t.string :met_type, null: false + t.string :met_location, null: true + t.integer :met_level, null: false + t.boolean :shiny, null: false, default: false + t.string :nature, null: false + t.string :gender, null: false + t.boolean :second_ability, null: false + t.string :unown_letter, null: true, limit: 1 + + t.timestamps + end + + add_index :pokeviewer_pokemon, :uuid, unique: true + add_index :pokeviewer_pokemon, :key, unique: true + + add_foreign_key :pokeviewer_pokemon, :pokeviewer_species, + column: :species_id + + add_foreign_key :pokeviewer_pokemon, :pokeviewer_trainers, + column: :trainer_id + end +end diff --git a/db/migrate/20171015171542_create_pokeviewer_moves.pokeviewer.rb b/db/migrate/20171015171542_create_pokeviewer_moves.pokeviewer.rb new file mode 100644 index 0000000..47fa68f --- /dev/null +++ b/db/migrate/20171015171542_create_pokeviewer_moves.pokeviewer.rb @@ -0,0 +1,13 @@ +# This migration comes from pokeviewer (originally 20170917011102) +class CreatePokeviewerMoves < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_moves do |t| + t.string :name, null: false, limit: 191 + t.integer :pp, null: false + + t.timestamps + end + + add_index :pokeviewer_moves, :name, unique: true + end +end diff --git a/db/migrate/20171015171543_create_pokeviewer_revisions.pokeviewer.rb b/db/migrate/20171015171543_create_pokeviewer_revisions.pokeviewer.rb new file mode 100644 index 0000000..c44c227 --- /dev/null +++ b/db/migrate/20171015171543_create_pokeviewer_revisions.pokeviewer.rb @@ -0,0 +1,52 @@ +# This migration comes from pokeviewer (originally 20170917011258) +class CreatePokeviewerRevisions < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_revisions do |t| + t.references :pokemon, null: false + t.integer :sequential_id, null: false + t.string :nickname, null: false + t.integer :experience, null: false + t.integer :level, null: false + t.integer :hp, null: false + t.integer :attack, null: false + t.integer :defense, null: false + t.integer :special_attack, null: false + t.integer :special_defense, null: false + t.integer :speed, null: false + t.integer :coolness, null: false + t.integer :beauty, null: false + t.integer :cuteness, null: false + t.integer :smartness, null: false + t.integer :toughness, null: false + t.integer :sheen, null: false + t.integer :hold_item, null: true + t.references :move_1, null: false + t.references :move_2, null: true + t.references :move_3, null: true + t.references :move_4, null: true + t.integer :move_1_pp_bonuses, null: false, default: 0 + t.integer :move_2_pp_bonuses, null: false, default: 0 + t.integer :move_3_pp_bonuses, null: false, default: 0 + t.integer :move_4_pp_bonuses, null: false, default: 0 + + t.timestamps + end + + add_index :pokeviewer_revisions, [:pokemon_id, :sequential_id], unique: true + + add_foreign_key :pokeviewer_revisions, :pokewalker_pokemon, + column: :pokemon_id + + add_foreign_key :pokeviewer_revisions, :pokewalker_moves, + column: :move_1_id + + add_foreign_key :pokeviewer_revisions, :pokewalker_moves, + column: :move_2_id + + add_foreign_key :pokeviewer_revisions, :pokewalker_moves, + column: :move_3_id + + add_foreign_key :pokeviewer_revisions, :pokewalker_moves, + column: :move_4_id + end +end diff --git a/db/migrate/20171015171544_make_met_level_nullable.pokeviewer.rb b/db/migrate/20171015171544_make_met_level_nullable.pokeviewer.rb new file mode 100644 index 0000000..058a591 --- /dev/null +++ b/db/migrate/20171015171544_make_met_level_nullable.pokeviewer.rb @@ -0,0 +1,6 @@ +# This migration comes from pokeviewer (originally 20170924035127) +class MakeMetLevelNullable < ActiveRecord::Migration[5.1] + def change + change_column :pokeviewer_pokemon, :met_level, :integer, null: true + end +end diff --git a/db/migrate/20171015171545_add_ot_gender_to_pokemon.pokeviewer.rb b/db/migrate/20171015171545_add_ot_gender_to_pokemon.pokeviewer.rb new file mode 100644 index 0000000..8ad7f77 --- /dev/null +++ b/db/migrate/20171015171545_add_ot_gender_to_pokemon.pokeviewer.rb @@ -0,0 +1,6 @@ +# This migration comes from pokeviewer (originally 20170924152817) +class AddOtGenderToPokemon < ActiveRecord::Migration[5.1] + def change + add_column :pokeviewer_pokemon, :ot_gender, :string, null: false, default: "" + end +end diff --git a/db/migrate/20171015171546_add_storage_info_to_pokemon.pokeviewer.rb b/db/migrate/20171015171546_add_storage_info_to_pokemon.pokeviewer.rb new file mode 100644 index 0000000..794dd13 --- /dev/null +++ b/db/migrate/20171015171546_add_storage_info_to_pokemon.pokeviewer.rb @@ -0,0 +1,7 @@ +# This migration comes from pokeviewer (originally 20170924160524) +class AddStorageInfoToPokemon < ActiveRecord::Migration[5.1] + def change + add_column :pokeviewer_pokemon, :box, :integer, null: true + add_column :pokeviewer_pokemon, :slot, :integer, null: true + end +end diff --git a/db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb b/db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb new file mode 100644 index 0000000..90323d1 --- /dev/null +++ b/db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb @@ -0,0 +1,16 @@ +# This migration comes from pokeviewer (originally 20170924224550) +class CreatePokeviewerBoxes < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_boxes do |t| + t.references :trainer, null: false + t.integer :number, null: false + t.string :name, null: false + + t.timestamps + end + + add_foreign_key :pokeviewer_boxes, :pokeviewer_trainers, column: :trainer_id + + add_index :pokeviewer_boxes, [:trainer_id, :number], unique: true + end +end diff --git a/db/migrate/20171015171548_create_pokeviewer_locations.pokeviewer.rb b/db/migrate/20171015171548_create_pokeviewer_locations.pokeviewer.rb new file mode 100644 index 0000000..c5589b0 --- /dev/null +++ b/db/migrate/20171015171548_create_pokeviewer_locations.pokeviewer.rb @@ -0,0 +1,10 @@ +# This migration comes from pokeviewer (originally 20170925013807) +class CreatePokeviewerLocations < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_locations do |t| + t.string :name, null: false + + t.timestamps + end + end +end diff --git a/db/migrate/20171015171549_add_ribbons_to_revision.pokeviewer.rb b/db/migrate/20171015171549_add_ribbons_to_revision.pokeviewer.rb new file mode 100644 index 0000000..01f4c2d --- /dev/null +++ b/db/migrate/20171015171549_add_ribbons_to_revision.pokeviewer.rb @@ -0,0 +1,25 @@ +# This migration comes from pokeviewer (originally 20170929211529) +class AddRibbonsToRevision < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_revisions do |t| + t.integer :cool_ribbons, null: false, default: 0 + t.integer :beauty_ribbons, null: false, default: 0 + t.integer :cute_ribbons, null: false, default: 0 + t.integer :smart_ribbons, null: false, default: 0 + t.integer :tough_ribbons, null: false, default: 0 + + t.boolean :champion_ribbon, default: false + t.boolean :winning_ribbon, default: false + t.boolean :victory_ribbon, default: false + t.boolean :artist_ribbon, default: false + t.boolean :effort_ribbon, default: false + t.boolean :marine_ribbon, default: false + t.boolean :land_ribbon, default: false + t.boolean :sky_ribbon, default: false + t.boolean :country_ribbon, default: false + t.boolean :national_ribbon, default: false + t.boolean :earth_ribbon, default: false + t.boolean :world_ribbon, default: false + end + end +end diff --git a/db/migrate/20171015171550_create_pokeviewer_gift_ribbons.pokeviewer.rb b/db/migrate/20171015171550_create_pokeviewer_gift_ribbons.pokeviewer.rb new file mode 100644 index 0000000..5c055f4 --- /dev/null +++ b/db/migrate/20171015171550_create_pokeviewer_gift_ribbons.pokeviewer.rb @@ -0,0 +1,10 @@ +# This migration comes from pokeviewer (originally 20170929221317) +class CreatePokeviewerGiftRibbons < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_gift_ribbons do |t| + t.string :description, null: false + + t.timestamps + end + end +end diff --git a/db/migrate/20171015171551_add_gift_ribbons_to_trainer.pokeviewer.rb b/db/migrate/20171015171551_add_gift_ribbons_to_trainer.pokeviewer.rb new file mode 100644 index 0000000..5bef8d5 --- /dev/null +++ b/db/migrate/20171015171551_add_gift_ribbons_to_trainer.pokeviewer.rb @@ -0,0 +1,35 @@ +# This migration comes from pokeviewer (originally 20170930021856) +class AddGiftRibbonsToTrainer < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_trainers do |t| + t.references :marine_ribbon, null: true + t.references :land_ribbon, null: true + t.references :sky_ribbon, null: true + t.references :country_ribbon, null: true + t.references :national_ribbon, null: true + t.references :earth_ribbon, null: true + t.references :world_ribbon, null: true + end + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :marine_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :land_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :sky_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :country_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :national_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :earth_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :world_ribbon_id + end +end diff --git a/db/migrate/20171015171552_create_pokeviewer_items.pokeviewer.rb b/db/migrate/20171015171552_create_pokeviewer_items.pokeviewer.rb new file mode 100644 index 0000000..7adc387 --- /dev/null +++ b/db/migrate/20171015171552_create_pokeviewer_items.pokeviewer.rb @@ -0,0 +1,17 @@ +# This migration comes from pokeviewer (originally 20170930185514) +class CreatePokeviewerItems < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_items do |t| + t.string :name, null: false + t.boolean :tm, null: false, default: false + t.references :move, null: true + t.string :rs_description + t.string :frlg_description + t.string :emerald_description + + t.timestamps + end + + add_foreign_key :pokeviewer_items, :pokeviewer_moves, column: :move_id + end +end diff --git a/db/migrate/20171015171553_add_description_and_type_to_moves.pokeviewer.rb b/db/migrate/20171015171553_add_description_and_type_to_moves.pokeviewer.rb new file mode 100644 index 0000000..0eb7cb1 --- /dev/null +++ b/db/migrate/20171015171553_add_description_and_type_to_moves.pokeviewer.rb @@ -0,0 +1,15 @@ +# This migration comes from pokeviewer (originally 20170930190647) +class AddDescriptionAndTypeToMoves < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_moves do |t| + t.string :move_type, null: false, default: "" + t.string :rs_description, null: false, default: "" + t.string :frlg_description, null: false, default: "" + t.string :emerald_description + end + + change_column_default :pokeviewer_moves, :move_type, nil + change_column_default :pokeviewer_moves, :rs_description, nil + change_column_default :pokeviewer_moves, :frlg_description, nil + end +end diff --git a/db/migrate/20171015171554_rename_revision_hold_item.pokeviewer.rb b/db/migrate/20171015171554_rename_revision_hold_item.pokeviewer.rb new file mode 100644 index 0000000..f7246de --- /dev/null +++ b/db/migrate/20171015171554_rename_revision_hold_item.pokeviewer.rb @@ -0,0 +1,10 @@ +# This migration comes from pokeviewer (originally 20170930213633) +class RenameRevisionHoldItem < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_revisions do |t| + t.rename :hold_item, :item_id + end + + add_foreign_key :pokeviewer_revisions, :pokeviewer_items, column: :item_id + end +end diff --git a/db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb b/db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb new file mode 100644 index 0000000..afb5987 --- /dev/null +++ b/db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb @@ -0,0 +1,31 @@ +# This migration comes from pokeviewer (originally 20171003154157) +class RenamePokemonMetLocation < ActiveRecord::Migration[5.1] + def up + add_column :pokeviewer_pokemon, :location_id, :integer, null: true + + add_foreign_key :pokeviewer_pokemon, :pokeviewer_locations, + column: :location_id + + Pokeviewer::Pokemon.all.each do |p| + unless p.met_location.nil? + p.location_id = p.met_location.to_i + p.save! + end + end + + remove_column :pokeviewer_pokemon, :met_location + end + + def down + add_column :pokeviewer_pokemon, :met_location, :string + + Pokeviewer::Pokemon.all.each do |p| + unless p.location_id.nil? + p.met_location = p.location_id.to_s + p.save! + end + end + + remove_column :pokeviewer_pokemon, :location_id + end +end diff --git a/db/migrate/20171015171556_remove_boxes.pokeviewer.rb b/db/migrate/20171015171556_remove_boxes.pokeviewer.rb new file mode 100644 index 0000000..c3cbbb1 --- /dev/null +++ b/db/migrate/20171015171556_remove_boxes.pokeviewer.rb @@ -0,0 +1,107 @@ +# This migration comes from pokeviewer (originally 20171003191205) +class RemoveBoxes < ActiveRecord::Migration[5.1] + def up + change_table :pokeviewer_trainers do |t| + t.string :box_1_name, null: false, default: "" + t.string :box_2_name, null: false, default: "" + t.string :box_3_name, null: false, default: "" + t.string :box_4_name, null: false, default: "" + t.string :box_5_name, null: false, default: "" + t.string :box_6_name, null: false, default: "" + t.string :box_7_name, null: false, default: "" + t.string :box_8_name, null: false, default: "" + t.string :box_9_name, null: false, default: "" + t.string :box_10_name, null: false, default: "" + t.string :box_11_name, null: false, default: "" + t.string :box_12_name, null: false, default: "" + t.string :box_13_name, null: false, default: "" + t.string :box_14_name, null: false, default: "" + end + + change_column_default :pokeviewer_trainers, :box_1_name, nil + change_column_default :pokeviewer_trainers, :box_2_name, nil + change_column_default :pokeviewer_trainers, :box_3_name, nil + change_column_default :pokeviewer_trainers, :box_4_name, nil + change_column_default :pokeviewer_trainers, :box_5_name, nil + change_column_default :pokeviewer_trainers, :box_6_name, nil + change_column_default :pokeviewer_trainers, :box_7_name, nil + change_column_default :pokeviewer_trainers, :box_8_name, nil + change_column_default :pokeviewer_trainers, :box_9_name, nil + change_column_default :pokeviewer_trainers, :box_10_name, nil + change_column_default :pokeviewer_trainers, :box_11_name, nil + change_column_default :pokeviewer_trainers, :box_12_name, nil + change_column_default :pokeviewer_trainers, :box_13_name, nil + change_column_default :pokeviewer_trainers, :box_14_name, nil + + Pokeviewer::Trainer.all.each do |t| + boxes = ActiveRecord::Base.connection.select_all( + "SELECT * FROM pokeviewer_boxes WHERE trainer_id = ? ORDER BY number ASC", + t.trainer_id).map { |b| b["name"] } + + t.box_1_name = boxes.shift + t.box_2_name = boxes.shift + t.box_3_name = boxes.shift + t.box_4_name = boxes.shift + t.box_5_name = boxes.shift + t.box_6_name = boxes.shift + t.box_7_name = boxes.shift + t.box_8_name = boxes.shift + t.box_9_name = boxes.shift + t.box_10_name = boxes.shift + t.box_11_name = boxes.shift + t.box_12_name = boxes.shift + t.box_13_name = boxes.shift + t.box_14_name = boxes.shift + + t.save + end + + drop_table :pokeviewer_boxes + end + + def down + create_table :pokeviewer_boxes do |t| + t.integer "trainer_id", null: false + t.integer "number", null: false + t.string "name", null: false + + t.timestamps + end + + add_index :pokeviewer_boxes, [:trainer_id, :number], unique: true + + add_foreign_key :pokeviewer_boxes, :pokeviewer_trainers, column: :trainer_id + + Pokeviewer::Trainer.all.each do |t| + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 1, name: t.box_1_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 2, name: t.box_2_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 3, name: t.box_3_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 4, name: t.box_4_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 5, name: t.box_5_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 6, name: t.box_6_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 7, name: t.box_7_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 8, name: t.box_8_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 9, name: t.box_9_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 10, name: t.box_10_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 11, name: t.box_11_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 12, name: t.box_12_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 13, name: t.box_13_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 14, name: t.box_14_name) + end + + remove_column :pokeviewer_trainers, :box_1_name + remove_column :pokeviewer_trainers, :box_2_name + remove_column :pokeviewer_trainers, :box_3_name + remove_column :pokeviewer_trainers, :box_4_name + remove_column :pokeviewer_trainers, :box_5_name + remove_column :pokeviewer_trainers, :box_6_name + remove_column :pokeviewer_trainers, :box_7_name + remove_column :pokeviewer_trainers, :box_8_name + remove_column :pokeviewer_trainers, :box_9_name + remove_column :pokeviewer_trainers, :box_10_name + remove_column :pokeviewer_trainers, :box_11_name + remove_column :pokeviewer_trainers, :box_12_name + remove_column :pokeviewer_trainers, :box_13_name + remove_column :pokeviewer_trainers, :box_14_name + end +end diff --git a/db/migrate/20171015171557_add_pokeball_to_pokemon.pokeviewer.rb b/db/migrate/20171015171557_add_pokeball_to_pokemon.pokeviewer.rb new file mode 100644 index 0000000..01f6f97 --- /dev/null +++ b/db/migrate/20171015171557_add_pokeball_to_pokemon.pokeviewer.rb @@ -0,0 +1,10 @@ +# This migration comes from pokeviewer (originally 20171004203404) +class AddPokeballToPokemon < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_pokemon do |t| + t.string :pokeball, null: false, default: :poke + end + + change_column_default :pokeviewer_pokemon, :pokeball, nil + end +end diff --git a/db/migrate/20171015171558_create_pokeviewer_abilities.pokeviewer.rb b/db/migrate/20171015171558_create_pokeviewer_abilities.pokeviewer.rb new file mode 100644 index 0000000..3120683 --- /dev/null +++ b/db/migrate/20171015171558_create_pokeviewer_abilities.pokeviewer.rb @@ -0,0 +1,13 @@ +# This migration comes from pokeviewer (originally 20171011015325) +class CreatePokeviewerAbilities < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_abilities do |t| + t.string :name, null: false, limit: 191 + t.string :description, null: false + + t.timestamps + end + + add_index :pokeviewer_abilities, :name, unique: true + end +end diff --git a/db/migrate/20171015171559_add_type_and_ability_to_species.pokeviewer.rb b/db/migrate/20171015171559_add_type_and_ability_to_species.pokeviewer.rb new file mode 100644 index 0000000..a7da236 --- /dev/null +++ b/db/migrate/20171015171559_add_type_and_ability_to_species.pokeviewer.rb @@ -0,0 +1,20 @@ +# This migration comes from pokeviewer (originally 20171011015648) +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.integer :ability_1_id, null: false, default: 0 + t.integer :ability_2_id + 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 diff --git a/db/schema.rb b/db/schema.rb index fc6614a..ede1db3 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: 20170703013609) do +ActiveRecord::Schema.define(version: 20171015171559) do create_table "ckeditor_assets", force: :cascade do |t| t.string "data_file_name", null: false @@ -34,6 +34,179 @@ ActiveRecord::Schema.define(version: 20170703013609) do t.datetime "updated_at", null: false end + create_table "pokeviewer_abilities", force: :cascade do |t| + t.string "name", limit: 191, null: false + t.string "description", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_pokeviewer_abilities_on_name", unique: true + end + + create_table "pokeviewer_gift_ribbons", force: :cascade do |t| + t.string "description", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "pokeviewer_items", force: :cascade do |t| + t.string "name", null: false + t.boolean "tm", default: false, null: false + t.integer "move_id" + t.string "rs_description" + t.string "frlg_description" + t.string "emerald_description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["move_id"], name: "index_pokeviewer_items_on_move_id" + end + + create_table "pokeviewer_locations", force: :cascade do |t| + t.string "name", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "pokeviewer_moves", force: :cascade do |t| + t.string "name", limit: 191, null: false + t.integer "pp", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "move_type", null: false + t.string "rs_description", null: false + t.string "frlg_description", null: false + t.string "emerald_description" + t.index ["name"], name: "index_pokeviewer_moves_on_name", unique: true + end + + create_table "pokeviewer_pokemon", force: :cascade do |t| + t.string "uuid", limit: 191, null: false + t.integer "species_id", null: false + t.integer "trainer_id" + t.string "key", limit: 191 + t.string "ot_name", null: false + t.integer "ot_number", null: false + t.string "met_type", null: false + t.integer "met_level" + t.boolean "shiny", default: false, null: false + t.string "nature", null: false + t.string "gender", null: false + t.boolean "second_ability", null: false + t.string "unown_letter", limit: 1 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "ot_gender", default: "", null: false + t.integer "box" + t.integer "slot" + t.integer "location_id" + t.string "pokeball", null: false + t.index ["key"], name: "index_pokeviewer_pokemon_on_key", unique: true + t.index ["species_id"], name: "index_pokeviewer_pokemon_on_species_id" + t.index ["trainer_id"], name: "index_pokeviewer_pokemon_on_trainer_id" + t.index ["uuid"], name: "index_pokeviewer_pokemon_on_uuid", unique: true + end + + create_table "pokeviewer_revisions", force: :cascade do |t| + t.integer "pokemon_id", null: false + t.integer "sequential_id", null: false + t.string "nickname", null: false + t.integer "experience", null: false + t.integer "level", null: false + t.integer "hp", null: false + t.integer "attack", null: false + t.integer "defense", null: false + t.integer "special_attack", null: false + t.integer "special_defense", null: false + t.integer "speed", null: false + t.integer "coolness", null: false + t.integer "beauty", null: false + t.integer "cuteness", null: false + t.integer "smartness", null: false + t.integer "toughness", null: false + t.integer "sheen", null: false + t.integer "item_id" + t.integer "move_1_id", null: false + t.integer "move_2_id" + t.integer "move_3_id" + t.integer "move_4_id" + t.integer "move_1_pp_bonuses", default: 0, null: false + t.integer "move_2_pp_bonuses", default: 0, null: false + t.integer "move_3_pp_bonuses", default: 0, null: false + t.integer "move_4_pp_bonuses", default: 0, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "cool_ribbons", default: 0, null: false + t.integer "beauty_ribbons", default: 0, null: false + t.integer "cute_ribbons", default: 0, null: false + t.integer "smart_ribbons", default: 0, null: false + t.integer "tough_ribbons", default: 0, null: false + t.boolean "champion_ribbon", default: false + t.boolean "winning_ribbon", default: false + t.boolean "victory_ribbon", default: false + t.boolean "artist_ribbon", default: false + t.boolean "effort_ribbon", default: false + t.boolean "marine_ribbon", default: false + t.boolean "land_ribbon", default: false + t.boolean "sky_ribbon", default: false + t.boolean "country_ribbon", default: false + t.boolean "national_ribbon", default: false + t.boolean "earth_ribbon", default: false + t.boolean "world_ribbon", default: false + t.index ["move_1_id"], name: "index_pokeviewer_revisions_on_move_1_id" + t.index ["move_2_id"], name: "index_pokeviewer_revisions_on_move_2_id" + t.index ["move_3_id"], name: "index_pokeviewer_revisions_on_move_3_id" + t.index ["move_4_id"], name: "index_pokeviewer_revisions_on_move_4_id" + t.index ["pokemon_id", "sequential_id"], name: "index_pokeviewer_revisions_on_pokemon_id_and_sequential_id", unique: true + t.index ["pokemon_id"], name: "index_pokeviewer_revisions_on_pokemon_id" + end + + create_table "pokeviewer_species", force: :cascade do |t| + t.string "name", limit: 191, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "type_1", null: false + t.string "type_2" + t.integer "ability_1_id", null: false + t.integer "ability_2_id" + t.index ["name"], name: "index_pokeviewer_species_on_name", unique: true + end + + create_table "pokeviewer_trainers", force: :cascade do |t| + t.string "game", null: false + t.string "name", limit: 191, null: false + t.integer "number", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "marine_ribbon_id" + t.integer "land_ribbon_id" + t.integer "sky_ribbon_id" + t.integer "country_ribbon_id" + t.integer "national_ribbon_id" + t.integer "earth_ribbon_id" + t.integer "world_ribbon_id" + t.string "box_1_name", null: false + t.string "box_2_name", null: false + t.string "box_3_name", null: false + t.string "box_4_name", null: false + t.string "box_5_name", null: false + t.string "box_6_name", null: false + t.string "box_7_name", null: false + t.string "box_8_name", null: false + t.string "box_9_name", null: false + t.string "box_10_name", null: false + t.string "box_11_name", null: false + t.string "box_12_name", null: false + t.string "box_13_name", null: false + t.string "box_14_name", null: false + t.index ["country_ribbon_id"], name: "index_pokeviewer_trainers_on_country_ribbon_id" + t.index ["earth_ribbon_id"], name: "index_pokeviewer_trainers_on_earth_ribbon_id" + t.index ["land_ribbon_id"], name: "index_pokeviewer_trainers_on_land_ribbon_id" + t.index ["marine_ribbon_id"], name: "index_pokeviewer_trainers_on_marine_ribbon_id" + t.index ["name", "number"], name: "index_pokeviewer_trainers_on_name_and_number", unique: true + t.index ["national_ribbon_id"], name: "index_pokeviewer_trainers_on_national_ribbon_id" + t.index ["sky_ribbon_id"], name: "index_pokeviewer_trainers_on_sky_ribbon_id" + t.index ["world_ribbon_id"], name: "index_pokeviewer_trainers_on_world_ribbon_id" + end + create_table "records", force: :cascade do |t| t.text "description" t.string "recordable_type", limit: 191 @@ -57,8 +230,10 @@ ActiveRecord::Schema.define(version: 20170703013609) do t.string "last_sign_in_ip" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "pokeviewer_token", limit: 191 t.index ["email"], name: "index_users_on_email", unique: true t.index ["login"], name: "index_users_on_login", unique: true + t.index ["pokeviewer_token"], name: "index_users_on_pokeviewer_token", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end diff --git a/db/seeds.rb b/db/seeds.rb index 1beea2a..11823c8 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,3 +5,4 @@ # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Character.create(name: 'Luke', movie: movies.first) +Pokeviewer::Engine.load_seed \ No newline at end of file -- cgit 1.4.1