From 5fc450ebd4249efc15e41b1b152a214697f5f415 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 7 Apr 2021 20:44:37 -0400 Subject: PTU natures --- db/migrate/20210408001502_create_ptu_natures.rb | 11 +++++++++++ db/schema.rb | 10 +++++++++- db/seeds.rb | 9 +++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20210408001502_create_ptu_natures.rb (limited to 'db') diff --git a/db/migrate/20210408001502_create_ptu_natures.rb b/db/migrate/20210408001502_create_ptu_natures.rb new file mode 100644 index 0000000..57692fd --- /dev/null +++ b/db/migrate/20210408001502_create_ptu_natures.rb @@ -0,0 +1,11 @@ +class CreatePtuNatures < ActiveRecord::Migration[6.1] + def change + create_table :ptu_natures do |t| + t.string :name + t.string :raises + t.string :lowers + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 927a80f..33dd112 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: 2021_04_07_005347) do +ActiveRecord::Schema.define(version: 2021_04_08_001502) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -27,6 +27,14 @@ ActiveRecord::Schema.define(version: 2021_04_07_005347) do t.datetime "updated_at", precision: 6, null: false end + create_table "ptu_natures", force: :cascade do |t| + t.string "name" + t.string "raises" + t.string "lowers" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + create_table "ptu_pokemons", force: :cascade do |t| t.string "name" t.integer "base_hp" diff --git a/db/seeds.rb b/db/seeds.rb index 6d2b152..62656d5 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -14,3 +14,12 @@ end %w[Standard Shift Swift Free].each { |name| PtuActionType.find_or_create_by(name: name) } + +[%w[Cuddly hp atk], %w[Distracted hp def], %w[Proud hp spatk], %w[Decisive hp spdef], %w[Patient hp speed], + %w[Desperate atk hp], %w[Lonely atk def], %w[Adamant atk spatk], %w[Naughty atk spdef], %w[Brave atk speed], + %w[Stark def hp], %w[Bold def atk], %w[Impish def spatk], %w[Lax def spdef], %w[Relaxed def speed], + %w[Curious spatk hp], %w[Modest spatk atk], %w[Mild spatk def], %w[Rash spatk spdef], %w[Quiet spatk speed], + %w[Dreamy spdef hp], %w[Calm spdef atk], %w[Gentle spdef def], %w[Careful spdef spatk], %w[Sassy spdef speed], + %w[Skittish speed hp], %w[Timid speed atk], %w[Hasty speed def], %w[Jolly speed spatk], %w[Naive speed spdef], + %w[Composed hp hp], %w[Hardy atk atk], %w[Docile def def], %w[Bashful spatk spatk], %w[Quirky spdef spdef], + %w[Serious speed speed]].each { |n| PtuNature.find_or_create_by(name: n[0], raises: n[1], lowers: n[2]) } -- cgit v1.2.3