class CreateWowCharacters < ActiveRecord::Migration[6.1] def change create_table :wow_characters do |t| t.belongs_to :user t.belongs_to :wow_realm t.belongs_to :wow_class t.belongs_to :wow_race t.belongs_to :wow_character_title 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.timestamp :last_login_timestamp t.integer :average_item_level t.integer :equipped_item_level t.string :href t.timestamps end add_index :wow_characters, :character_id, unique: true end end