add covenant

This commit is contained in:
2021-05-30 17:49:54 +02:00
parent d0e5824d40
commit 5b3da08707
29 changed files with 157 additions and 9 deletions

View File

@@ -0,0 +1,14 @@
class CreateWowCovenants < ActiveRecord::Migration[6.1]
def change
create_table :wow_covenants do |t|
t.integer :covenant_id
t.jsonb :name
t.jsonb :description
t.integer :media_id
t.timestamps
end
add_index :wow_covenants, :covenant_id, unique: true
end
end

View File

@@ -0,0 +1,11 @@
class CreateWowCovenantProgresses < ActiveRecord::Migration[6.1]
def change
create_table :wow_covenant_progresses do |t|
t.integer :renown_level
t.belongs_to :wow_characters
t.belongs_to :wow_covenant
t.timestamps
end
end
end

View File

@@ -0,0 +1,5 @@
class RenameCovenantProgressBelongToWowCharacter < ActiveRecord::Migration[6.1]
def change
rename_column :wow_covenant_progresses, :wow_characters_id, :wow_character_id
end
end

22
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_05_30_121125) do
ActiveRecord::Schema.define(version: 2021_05_30_151735) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -151,6 +151,26 @@ ActiveRecord::Schema.define(version: 2021_05_30_121125) do
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_geo_maps", force: :cascade do |t|
t.integer "map_id"
t.jsonb "name"