Add local_id to Party object

We can't save in the user_id column because it is an association, but that's okay
This commit is contained in:
Justin Edmund 2023-01-31 00:54:17 -08:00
parent bedd72a753
commit cce33ebf08
4 changed files with 11 additions and 3 deletions

View file

@ -68,9 +68,10 @@ module Api
include_view :characters
include_view :job_skills
fields :local_id, :description, :charge_attack, :button_count, :turn_count, :chain_count
association :accessory,
blueprint: JobAccessoryBlueprint
fields :description, :charge_attack, :button_count, :turn_count, :chain_count
association :source_party,
blueprint: PartyBlueprint,
@ -90,7 +91,7 @@ module Api
include_view :full
fields :edit_key
end
view :destroyed do
fields :name, :description, :created_at, :updated_at
end

View file

@ -173,6 +173,7 @@ module Api
params.require(:party).permit(
:user_id,
:local_id,
:extra,
:name,
:description,

View file

@ -0,0 +1,5 @@
class AddLocalIdToParties < ActiveRecord::Migration[7.0]
def change
add_column :parties, :local_id, :uuid, null: true, unique: true
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_01_31_082521) do
ActiveRecord::Schema[7.0].define(version: 2023_01_31_084343) do
# These are extensions that must be enabled in order to support this database
enable_extension "btree_gin"
enable_extension "pg_trgm"
@ -226,6 +226,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_31_082521) do
t.integer "characters_count"
t.integer "summons_count"
t.string "edit_key"
t.uuid "local_id"
t.index ["accessory_id"], name: "index_parties_on_accessory_id"
t.index ["job_id"], name: "index_parties_on_job_id"
t.index ["skill0_id"], name: "index_parties_on_skill0_id"