Files
site/db/schema.rb

540 lines
21 KiB
Ruby
Generated

# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_08_15_130405) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "completed_wow_achievement_criteria", force: :cascade do |t|
t.integer "amount"
t.boolean "is_completed"
t.bigint "wow_character_id"
t.bigint "wow_achievement_criterium_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["wow_achievement_criterium_id"], name: "completed_achievement_criteria_on_achievement_criterium_id"
t.index ["wow_character_id"], name: "index_completed_wow_achievement_criteria_on_wow_character_id"
end
create_table "completed_wow_achievements", force: :cascade do |t|
t.datetime "completed_timestamp"
t.bigint "wow_character_id"
t.bigint "wow_achievement_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["wow_achievement_id"], name: "index_completed_wow_achievements_on_wow_achievement_id"
t.index ["wow_character_id"], name: "index_completed_wow_achievements_on_wow_character_id"
end
create_table "learned_wow_pet_abilities", force: :cascade do |t|
t.bigint "wow_pet_id"
t.bigint "wow_pet_ability_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["wow_pet_ability_id"], name: "index_learned_wow_pet_abilities_on_wow_pet_ability_id"
t.index ["wow_pet_id"], name: "index_learned_wow_pet_abilities_on_wow_pet_id"
end
create_table "mobility_string_translations", force: :cascade do |t|
t.string "locale", null: false
t.string "key", null: false
t.string "value"
t.string "translatable_type"
t.bigint "translatable_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["translatable_id", "translatable_type", "key"], name: "index_mobility_string_translations_on_translatable_attribute"
t.index ["translatable_id", "translatable_type", "locale", "key"], name: "index_mobility_string_translations_on_keys", unique: true
t.index ["translatable_type", "key", "value", "locale"], name: "index_mobility_string_translations_on_query_keys"
end
create_table "mobility_text_translations", force: :cascade do |t|
t.string "locale", null: false
t.string "key", null: false
t.text "value"
t.string "translatable_type"
t.bigint "translatable_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["translatable_id", "translatable_type", "key"], name: "index_mobility_text_translations_on_translatable_attribute"
t.index ["translatable_id", "translatable_type", "locale", "key"], name: "index_mobility_text_translations_on_keys", unique: true
end
create_table "rp_worlds", force: :cascade do |t|
t.string "name"
t.string "description"
t.bigint "user_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["user_id"], name: "index_rp_worlds_on_user_id"
end
create_table "user_obtain_wow_mounts", force: :cascade do |t|
t.bigint "user_id"
t.bigint "wow_mount_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["user_id"], name: "index_user_obtain_wow_mounts_on_user_id"
t.index ["wow_mount_id"], name: "index_user_obtain_wow_mounts_on_wow_mount_id"
end
create_table "user_obtain_wow_pets", force: :cascade do |t|
t.bigint "user_id"
t.bigint "wow_pet_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["user_id"], name: "index_user_obtain_wow_pets_on_user_id"
t.index ["wow_pet_id"], name: "index_user_obtain_wow_pets_on_wow_pet_id"
end
create_table "users", force: :cascade do |t|
t.string "email"
t.string "encrypted_password"
t.datetime "remember_created_at"
t.string "battletag", null: false
t.string "provider"
t.string "uid"
t.boolean "token_expires"
t.datetime "token_expire_at"
t.string "token"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "locale", default: "en-gb"
t.index ["battletag"], name: "index_users_on_battletag", unique: true
end
create_table "wow_achievement_categories", force: :cascade do |t|
t.integer "category_id", null: false
t.jsonb "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["category_id"], name: "index_wow_achievement_categories_on_category_id", unique: true
end
create_table "wow_achievement_criteria", force: :cascade do |t|
t.integer "criterium_id", null: false
t.jsonb "description"
t.integer "amount"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.bigint "parent_criterium_id"
t.jsonb "operator_name"
t.string "operator_type"
t.index ["criterium_id"], name: "index_wow_achievement_criteria_on_criterium_id", unique: true
t.index ["parent_criterium_id"], name: "index_wow_achievement_criteria_on_parent_criterium_id"
end
create_table "wow_achievements", force: :cascade do |t|
t.integer "achievement_id", null: false
t.jsonb "name"
t.jsonb "description"
t.integer "points"
t.boolean "is_account_wide"
t.integer "display_order"
t.string "icon"
t.bigint "wow_achievement_category_id"
t.bigint "wow_achievement_criterium_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.bigint "prerequisite_achievement_id"
t.jsonb "reward_description"
t.index ["achievement_id"], name: "index_wow_achievements_on_achievement_id", unique: true
t.index ["prerequisite_achievement_id"], name: "index_wow_achievements_on_prerequisite_achievement_id"
t.index ["wow_achievement_category_id"], name: "index_wow_achievements_on_wow_achievement_category_id"
t.index ["wow_achievement_criterium_id"], name: "index_wow_achievements_on_wow_achievement_criterium_id"
end
create_table "wow_character_media", force: :cascade do |t|
t.bigint "wow_character_id"
t.string "avatar"
t.string "inset"
t.string "main"
t.string "main_raw"
t.string "href"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["wow_character_id"], name: "index_wow_character_media_on_wow_character_id"
end
create_table "wow_character_play_rp_worlds", force: :cascade do |t|
t.string "status"
t.string "role"
t.bigint "wow_character_id"
t.bigint "rp_world_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["rp_world_id"], name: "index_wow_character_play_rp_worlds_on_rp_world_id"
t.index ["wow_character_id"], name: "index_wow_character_play_rp_worlds_on_wow_character_id"
end
create_table "wow_character_titles", force: :cascade do |t|
t.jsonb "name"
t.string "href"
t.jsonb "male_name"
t.jsonb "female_name"
t.integer "title_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["title_id"], name: "index_wow_character_titles_on_title_id", unique: true
end
create_table "wow_characters", force: :cascade do |t|
t.bigint "user_id"
t.bigint "wow_realm_id"
t.bigint "wow_class_id"
t.bigint "wow_race_id"
t.bigint "wow_character_title_id"
t.string "name"
t.string "gender"
t.jsonb "translated_gender"
t.string "faction"
t.jsonb "translated_faction"
t.integer "character_id", null: false
t.integer "level"
t.integer "account_id"
t.integer "achievements_points"
t.datetime "last_login_timestamp"
t.integer "average_item_level"
t.integer "equipped_item_level"
t.string "href"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.bigint "last_position_id"
t.bigint "bind_position_id"
t.bigint "wow_guild_id"
t.index ["character_id"], name: "index_wow_characters_on_character_id", unique: true
t.index ["user_id"], name: "index_wow_characters_on_user_id"
t.index ["wow_character_title_id"], name: "index_wow_characters_on_wow_character_title_id"
t.index ["wow_class_id"], name: "index_wow_characters_on_wow_class_id"
t.index ["wow_guild_id"], name: "index_wow_characters_on_wow_guild_id"
t.index ["wow_race_id"], name: "index_wow_characters_on_wow_race_id"
t.index ["wow_realm_id"], name: "index_wow_characters_on_wow_realm_id"
end
create_table "wow_classes", force: :cascade do |t|
t.jsonb "name"
t.string "href"
t.jsonb "male_name"
t.jsonb "female_name"
t.jsonb "power_type"
t.integer "class_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["class_id"], name: "index_wow_classes_on_class_id", unique: true
end
create_table "wow_covenant_progresses", force: :cascade do |t|
t.integer "renown_level"
t.bigint "wow_character_id"
t.bigint "wow_covenant_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["wow_character_id"], name: "index_wow_covenant_progresses_on_wow_character_id"
t.index ["wow_covenant_id"], name: "index_wow_covenant_progresses_on_wow_covenant_id"
end
create_table "wow_covenants", force: :cascade do |t|
t.integer "covenant_id"
t.jsonb "name"
t.jsonb "description"
t.integer "media_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["covenant_id"], name: "index_wow_covenants_on_covenant_id", unique: true
end
create_table "wow_creature_families", force: :cascade do |t|
t.integer "creature_family_id"
t.jsonb "name"
t.integer "media_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["creature_family_id"], name: "index_wow_creature_families_on_creature_family_id", unique: true
end
create_table "wow_creature_types", force: :cascade do |t|
t.integer "creature_type_id"
t.jsonb "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["creature_type_id"], name: "index_wow_creature_types_on_creature_type_id", unique: true
end
create_table "wow_creatures", force: :cascade do |t|
t.integer "creature_id"
t.jsonb "name"
t.boolean "is_tameable"
t.integer "display_id"
t.bigint "wow_creature_family_id"
t.bigint "wow_creature_type_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["creature_id"], name: "index_wow_creatures_on_creature_id", unique: true
t.index ["wow_creature_family_id"], name: "index_wow_creatures_on_wow_creature_family_id"
t.index ["wow_creature_type_id"], name: "index_wow_creatures_on_wow_creature_type_id"
end
create_table "wow_geo_maps", force: :cascade do |t|
t.integer "map_id"
t.jsonb "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["map_id"], name: "index_wow_geo_maps_on_map_id", unique: true
end
create_table "wow_geo_positions", force: :cascade do |t|
t.float "x"
t.float "y"
t.float "z"
t.float "facing"
t.bigint "wow_geo_zone_id"
t.bigint "wow_geo_map_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["wow_geo_map_id"], name: "index_wow_geo_positions_on_wow_geo_map_id"
t.index ["wow_geo_zone_id"], name: "index_wow_geo_positions_on_wow_geo_zone_id"
end
create_table "wow_geo_zones", force: :cascade do |t|
t.integer "zone_id"
t.jsonb "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["zone_id"], name: "index_wow_geo_zones_on_zone_id", unique: true
end
create_table "wow_guilds", force: :cascade do |t|
t.string "name"
t.integer "guild_id"
t.integer "achievement_points"
t.integer "member_count"
t.string "faction"
t.jsonb "translated_faction"
t.bigint "wow_realm_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["guild_id"], name: "index_wow_guilds_on_guild_id", unique: true
t.index ["wow_realm_id"], name: "index_wow_guilds_on_wow_realm_id"
end
create_table "wow_item_classes", force: :cascade do |t|
t.integer "item_class_id"
t.jsonb "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["item_class_id"], name: "index_wow_item_classes_on_item_class_id", unique: true
end
create_table "wow_item_inventory_types", force: :cascade do |t|
t.jsonb "name"
t.string "item_inventory_type"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["item_inventory_type"], name: "index_wow_item_inventory_types_on_item_inventory_type", unique: true
end
create_table "wow_item_qualities", force: :cascade do |t|
t.jsonb "name"
t.string "item_quality_type"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["item_quality_type"], name: "index_wow_item_qualities_on_item_quality_type", unique: true
end
create_table "wow_item_sub_classes", force: :cascade do |t|
t.integer "item_sub_class_id"
t.jsonb "display_name"
t.jsonb "verbose_name"
t.bigint "wow_item_class_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["item_sub_class_id"], name: "index_wow_item_sub_classes_on_item_sub_class_id"
t.index ["wow_item_class_id"], name: "index_wow_item_sub_classes_on_wow_item_class_id"
end
create_table "wow_items", force: :cascade do |t|
t.jsonb "name"
t.integer "level"
t.integer "required_level"
t.integer "sell_price"
t.boolean "is_equippable"
t.integer "media_id"
t.integer "max_count"
t.integer "purchase_price"
t.integer "item_id"
t.boolean "is_stackable"
t.bigint "wow_item_class_id"
t.bigint "wow_item_sub_class_id"
t.bigint "wow_item_quality_id"
t.bigint "wow_item_inventory_type_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["item_id"], name: "index_wow_items_on_item_id", unique: true
t.index ["wow_item_class_id"], name: "index_wow_items_on_wow_item_class_id"
t.index ["wow_item_inventory_type_id"], name: "index_wow_items_on_wow_item_inventory_type_id"
t.index ["wow_item_quality_id"], name: "index_wow_items_on_wow_item_quality_id"
t.index ["wow_item_sub_class_id"], name: "index_wow_items_on_wow_item_sub_class_id"
end
create_table "wow_mounts", force: :cascade do |t|
t.jsonb "name"
t.string "source_type"
t.jsonb "translated_source"
t.string "faction"
t.jsonb "translated_faction"
t.jsonb "description"
t.integer "mount_id", null: false
t.integer "creature_display_id"
t.string "href"
t.string "asset_zoom"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["mount_id"], name: "index_wow_mounts_on_mount_id", unique: true
end
create_table "wow_pet_abilities", force: :cascade do |t|
t.integer "ability_id"
t.jsonb "name"
t.string "battle_pet_type"
t.jsonb "translated_battle_pet_type"
t.integer "battle_pet_type_id"
t.integer "rounds"
t.string "media"
t.string "href"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["ability_id"], name: "index_wow_pet_abilities_on_ability_id", unique: true
end
create_table "wow_pets", force: :cascade do |t|
t.jsonb "name"
t.integer "pet_id"
t.string "href"
t.string "battle_pet_type"
t.jsonb "translated_battle_pet_type"
t.integer "battle_pet_type_id"
t.jsonb "description"
t.boolean "is_capturable"
t.boolean "is_tradable"
t.boolean "is_battlepet"
t.boolean "is_alliance_only"
t.boolean "is_horde_only"
t.string "icon"
t.boolean "is_random_creature_display"
t.string "source_type"
t.jsonb "translated_source_type"
t.integer "creature_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.integer "creature_display_id"
t.string "media_zoom_url"
t.index ["pet_id"], name: "index_wow_pets_on_pet_id", unique: true
end
create_table "wow_races", force: :cascade do |t|
t.jsonb "name"
t.string "href"
t.string "faction"
t.jsonb "translated_faction"
t.boolean "is_selectable"
t.boolean "is_allied_race"
t.jsonb "male_name"
t.jsonb "female_name"
t.integer "race_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["race_id"], name: "index_wow_races_on_race_id", unique: true
end
create_table "wow_realms", force: :cascade do |t|
t.jsonb "name"
t.string "href"
t.string "slug"
t.jsonb "category"
t.string "locale"
t.string "timezone"
t.jsonb "realm_type"
t.boolean "is_tournament"
t.integer "realm_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["realm_id"], name: "index_wow_realms_on_realm_id", unique: true
end
create_table "wow_reputation_tier_levels", force: :cascade do |t|
t.jsonb "name"
t.integer "min_value"
t.integer "max_value"
t.integer "order"
t.bigint "wow_reputation_tier_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["order"], name: "index_wow_reputation_tier_levels_on_order"
t.index ["wow_reputation_tier_id"], name: "index_wow_reputation_tier_levels_on_wow_reputation_tier_id"
end
create_table "wow_reputation_tiers", force: :cascade do |t|
t.string "href"
t.integer "reputation_tier_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["reputation_tier_id"], name: "index_wow_reputation_tiers_on_reputation_tier_id", unique: true
end
create_table "wow_reputations", force: :cascade do |t|
t.jsonb "name"
t.string "href"
t.string "faction"
t.jsonb "translated_faction"
t.jsonb "description"
t.integer "reputation_id", null: false
t.bigint "wow_reputation_tier_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.bigint "meta_wow_reputation_id"
t.index ["meta_wow_reputation_id"], name: "index_wow_reputations_on_meta_wow_reputation_id"
t.index ["reputation_id"], name: "index_wow_reputations_on_reputation_id", unique: true
t.index ["wow_reputation_tier_id"], name: "index_wow_reputations_on_wow_reputation_tier_id"
end
create_table "wow_spells", force: :cascade do |t|
t.integer "spell_id"
t.jsonb "name"
t.jsonb "description"
t.integer "media_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["spell_id"], name: "index_wow_spells_on_spell_id", unique: true
end
create_table "wow_standings", force: :cascade do |t|
t.bigint "wow_character_id"
t.bigint "wow_reputation_id"
t.integer "raw"
t.integer "value"
t.integer "max"
t.integer "tier"
t.jsonb "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["wow_character_id"], name: "index_wow_standings_on_wow_character_id"
t.index ["wow_reputation_id"], name: "index_wow_standings_on_wow_reputation_id"
end
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"
add_foreign_key "wow_characters", "wow_geo_positions", column: "last_position_id"
add_foreign_key "wow_reputations", "wow_reputations", column: "meta_wow_reputation_id"
end