improve achievement management and and views

This commit is contained in:
2021-08-24 20:53:32 +02:00
parent 39ebeea387
commit 2be44a89b8
18 changed files with 197 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
class AddWowAchievementCategorySelfJoin < ActiveRecord::Migration[6.1]
def change
add_reference :wow_achievement_categories, :parent_category, foreign_key: { to_table: :wow_achievement_categories }
end
end

View File

@@ -0,0 +1,6 @@
class AddColumnsToWowAchievementCategory < ActiveRecord::Migration[6.1]
def change
add_column :wow_achievement_categories, :is_guild_category, :boolean
add_column :wow_achievement_categories, :display_order, :integer
end
end

7
db/schema.rb generated
View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_08_15_130405) do
ActiveRecord::Schema.define(version: 2021_08_15_182820) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -118,7 +118,11 @@ ActiveRecord::Schema.define(version: 2021_08_15_130405) do
t.jsonb "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.bigint "parent_category_id"
t.boolean "is_guild_category"
t.integer "display_order"
t.index ["category_id"], name: "index_wow_achievement_categories_on_category_id", unique: true
t.index ["parent_category_id"], name: "index_wow_achievement_categories_on_parent_category_id"
end
create_table "wow_achievement_criteria", force: :cascade do |t|
@@ -531,6 +535,7 @@ ActiveRecord::Schema.define(version: 2021_08_15_130405) do
t.index ["wow_reputation_id"], name: "index_wow_standings_on_wow_reputation_id"
end
add_foreign_key "wow_achievement_categories", "wow_achievement_categories", column: "parent_category_id"
add_foreign_key "wow_achievement_criteria", "wow_achievement_criteria", column: "parent_criterium_id"
add_foreign_key "wow_achievements", "wow_achievements", column: "prerequisite_achievement_id"
add_foreign_key "wow_characters", "wow_geo_positions", column: "bind_position_id"