GridCharacter wasn't using UUID keys for some reason
This commit is contained in:
parent
9d4706b741
commit
15b72c43c6
3 changed files with 17 additions and 2 deletions
5
db/migrate/20220223213142_add_uuid_to_grid_character.rb
Normal file
5
db/migrate/20220223213142_add_uuid_to_grid_character.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class AddUuidToGridCharacter < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :grid_characters, :uuid, :uuid, default: "gen_random_uuid()", null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
class ChangeGridCharacterIdToUuid < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
change_table :grid_characters do |t|
|
||||
t.remove :id
|
||||
t.rename :uuid, :id
|
||||
end
|
||||
|
||||
execute "ALTER TABLE grid_characters ADD PRIMARY KEY (id);"
|
||||
end
|
||||
end
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2022_02_04_093125) do
|
||||
ActiveRecord::Schema.define(version: 2022_02_23_213548) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pgcrypto"
|
||||
|
|
@ -44,7 +44,7 @@ ActiveRecord::Schema.define(version: 2022_02_04_093125) do
|
|||
t.integer "max_atk_ulb"
|
||||
end
|
||||
|
||||
create_table "grid_characters", force: :cascade do |t|
|
||||
create_table "grid_characters", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.uuid "party_id"
|
||||
t.uuid "character_id"
|
||||
t.integer "uncap_level"
|
||||
|
|
|
|||
Loading…
Reference in a new issue