add management of items !
This commit is contained in:
12
db/migrate/20210528185500_create_wow_item_classes.rb
Normal file
12
db/migrate/20210528185500_create_wow_item_classes.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateWowItemClasses < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :wow_item_classes do |t|
|
||||
t.integer :item_class_id
|
||||
t.jsonb :name
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :wow_item_classes, :item_class_id, unique: true
|
||||
end
|
||||
end
|
||||
14
db/migrate/20210528185610_create_wow_item_sub_classes.rb
Normal file
14
db/migrate/20210528185610_create_wow_item_sub_classes.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateWowItemSubClasses < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :wow_item_sub_classes do |t|
|
||||
t.integer :item_sub_class_id
|
||||
t.jsonb :display_name
|
||||
t.jsonb :verbose_name
|
||||
t.belongs_to :wow_item_class
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :wow_item_sub_classes, :item_sub_class_id
|
||||
end
|
||||
end
|
||||
12
db/migrate/20210528185708_create_wow_item_qualities.rb
Normal file
12
db/migrate/20210528185708_create_wow_item_qualities.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateWowItemQualities < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :wow_item_qualities do |t|
|
||||
t.jsonb :name
|
||||
t.string :type
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :wow_item_qualities, :type, unique: true
|
||||
end
|
||||
end
|
||||
12
db/migrate/20210528185731_create_wow_item_inventory_types.rb
Normal file
12
db/migrate/20210528185731_create_wow_item_inventory_types.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateWowItemInventoryTypes < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :wow_item_inventory_types do |t|
|
||||
t.jsonb :name
|
||||
t.string :type
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :wow_item_inventory_types, :type, unique: true
|
||||
end
|
||||
end
|
||||
24
db/migrate/20210528185954_create_wow_items.rb
Normal file
24
db/migrate/20210528185954_create_wow_items.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
class CreateWowItems < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :wow_items 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.belongs_to :wow_item_class
|
||||
t.belongs_to :wow_item_sub_class
|
||||
t.belongs_to :wow_item_quality
|
||||
t.belongs_to :wow_item_inventory_type
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :wow_items, :item_id, unique: true
|
||||
end
|
||||
end
|
||||
6
db/migrate/20210528214602_rename_type_columns.rb
Normal file
6
db/migrate/20210528214602_rename_type_columns.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class RenameTypeColumns < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
rename_column :wow_item_qualities, :type, :item_quality_type
|
||||
rename_column :wow_item_inventory_types, :type, :item_inventory_type
|
||||
end
|
||||
end
|
||||
61
db/schema.rb
generated
61
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_05_28_125553) do
|
||||
ActiveRecord::Schema.define(version: 2021_05_28_214602) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -194,6 +194,65 @@ ActiveRecord::Schema.define(version: 2021_05_28_125553) do
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user