Add character_id field to character table

This is used for deduping characters so users can't add two of the same character to a grid.
This commit is contained in:
Justin Edmund 2022-11-17 02:26:15 -08:00
parent 9967d36f89
commit a76bda993f
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,5 @@
class AddCharacterIdToCharacters < ActiveRecord::Migration[6.1]
def change
add_column :characters, :character_id, :integer, array: true, null: false, default: []
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2022_04_10_190152) do
ActiveRecord::Schema.define(version: 2022_11_17_070255) do
# These are extensions that must be enabled in order to support this database
enable_extension "btree_gin"
@ -44,6 +44,7 @@ ActiveRecord::Schema.define(version: 2022_04_10_190152) do
t.boolean "ulb", default: false, null: false
t.integer "max_hp_ulb"
t.integer "max_atk_ulb"
t.integer "character_id", default: [], null: false, array: true
t.index ["name_en"], name: "index_characters_on_name_en", opclass: :gin_trgm_ops, using: :gin
end