Add data tables for weapons and summons
This lets us store wiki data and release dates for weapons and summons
This commit is contained in:
parent
665b82d0f7
commit
531bcbf2fe
5 changed files with 61 additions and 2 deletions
19
db/data/20230816061005_populate_wiki_columns.rb
Normal file
19
db/data/20230816061005_populate_wiki_columns.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class PopulateWikiColumns < ActiveRecord::Migration[7.0]
|
||||||
|
def up
|
||||||
|
Weapon.all.each do |c|
|
||||||
|
c.wiki_en = c.name_en
|
||||||
|
c.save
|
||||||
|
end
|
||||||
|
|
||||||
|
Summon.all.each do |c|
|
||||||
|
c.wiki_en = c.name_en
|
||||||
|
c.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
raise ActiveRecord::IrreversibleMigration
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -1 +1 @@
|
||||||
DataMigrate::Data.define(version: 20230716132721)
|
DataMigrate::Data.define(version: 20230816061005)
|
||||||
|
|
|
||||||
12
db/migrate/20230816015828_add_columns_to_weapons.rb
Normal file
12
db/migrate/20230816015828_add_columns_to_weapons.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
class AddColumnsToWeapons < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
add_column :weapons, :release_date, :date
|
||||||
|
add_column :weapons, :flb_date, :date
|
||||||
|
add_column :weapons, :ulb_date, :date
|
||||||
|
|
||||||
|
add_column :weapons, :wiki_en, :string, default: ''
|
||||||
|
add_column :weapons, :wiki_ja, :string, default: ''
|
||||||
|
add_column :weapons, :gamewith, :string, default: ''
|
||||||
|
add_column :weapons, :kamigame, :string, default: ''
|
||||||
|
end
|
||||||
|
end
|
||||||
13
db/migrate/20230816015904_add_columns_to_summons.rb
Normal file
13
db/migrate/20230816015904_add_columns_to_summons.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
class AddColumnsToSummons < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
add_column :summons, :summon_id, :integer
|
||||||
|
add_column :summons, :release_date, :date
|
||||||
|
add_column :summons, :flb_date, :date
|
||||||
|
add_column :summons, :ulb_date, :date
|
||||||
|
|
||||||
|
add_column :summons, :wiki_en, :string, default: ''
|
||||||
|
add_column :summons, :wiki_ja, :string, default: ''
|
||||||
|
add_column :summons, :gamewith, :string, default: ''
|
||||||
|
add_column :summons, :kamigame, :string, default: ''
|
||||||
|
end
|
||||||
|
end
|
||||||
17
db/schema.rb
17
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.0].define(version: 2023_07_17_011150) do
|
ActiveRecord::Schema[7.0].define(version: 2023_08_16_015904) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "btree_gin"
|
enable_extension "btree_gin"
|
||||||
enable_extension "pg_trgm"
|
enable_extension "pg_trgm"
|
||||||
|
|
@ -441,6 +441,14 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_17_011150) do
|
||||||
t.integer "max_hp_xlb"
|
t.integer "max_hp_xlb"
|
||||||
t.string "nicknames_en", default: [], null: false, array: true
|
t.string "nicknames_en", default: [], null: false, array: true
|
||||||
t.string "nicknames_jp", default: [], null: false, array: true
|
t.string "nicknames_jp", default: [], null: false, array: true
|
||||||
|
t.integer "summon_id"
|
||||||
|
t.date "release_date"
|
||||||
|
t.date "flb_date"
|
||||||
|
t.date "ulb_date"
|
||||||
|
t.string "wiki_en", default: ""
|
||||||
|
t.string "wiki_ja", default: ""
|
||||||
|
t.string "gamewith", default: ""
|
||||||
|
t.string "kamigame", default: ""
|
||||||
t.index ["name_en"], name: "index_summons_on_name_en", opclass: :gin_trgm_ops, using: :gin
|
t.index ["name_en"], name: "index_summons_on_name_en", opclass: :gin_trgm_ops, using: :gin
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -505,6 +513,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_17_011150) do
|
||||||
t.string "nicknames_jp", default: [], null: false, array: true
|
t.string "nicknames_jp", default: [], null: false, array: true
|
||||||
t.uuid "recruits_id"
|
t.uuid "recruits_id"
|
||||||
t.integer "max_awakening_level"
|
t.integer "max_awakening_level"
|
||||||
|
t.date "release_date"
|
||||||
|
t.date "flb_date"
|
||||||
|
t.date "ulb_date"
|
||||||
|
t.string "wiki_en", default: ""
|
||||||
|
t.string "wiki_ja", default: ""
|
||||||
|
t.string "gamewith", default: ""
|
||||||
|
t.string "kamigame", default: ""
|
||||||
t.index ["name_en"], name: "index_weapons_on_name_en", opclass: :gin_trgm_ops, using: :gin
|
t.index ["name_en"], name: "index_weapons_on_name_en", opclass: :gin_trgm_ops, using: :gin
|
||||||
t.index ["recruits_id"], name: "index_weapons_on_recruits_id"
|
t.index ["recruits_id"], name: "index_weapons_on_recruits_id"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue