diff --git a/db/migrate/20250115100327_remove_recruits_id_from_weapons.rb b/db/migrate/20250115100327_remove_recruits_id_from_weapons.rb new file mode 100644 index 0000000..3f34820 --- /dev/null +++ b/db/migrate/20250115100327_remove_recruits_id_from_weapons.rb @@ -0,0 +1,6 @@ +class RemoveRecruitsIdFromWeapons < ActiveRecord::Migration[7.0] + def change + remove_column :weapons, :recruits_id, :uuid + remove_index :weapons, :recruits_id if index_exists?(:weapons, :recruits_id) + end +end diff --git a/db/migrate/20250115100356_add_index_to_weapon_recruits.rb b/db/migrate/20250115100356_add_index_to_weapon_recruits.rb new file mode 100644 index 0000000..422283c --- /dev/null +++ b/db/migrate/20250115100356_add_index_to_weapon_recruits.rb @@ -0,0 +1,5 @@ +class AddIndexToWeaponRecruits < ActiveRecord::Migration[7.0] + def change + add_index :weapons, :recruits + end +end diff --git a/db/schema.rb b/db/schema.rb index 3c1ed5f..22ac3b7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2025_01_15_094528) do +ActiveRecord::Schema[7.0].define(version: 2025_01_15_100356) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" enable_extension "pg_trgm" @@ -456,7 +456,6 @@ ActiveRecord::Schema[7.0].define(version: 2025_01_15_094528) do t.integer "ax_type" t.boolean "limit", default: false, null: false t.boolean "ax", default: false, null: false - t.uuid "recruits_id" t.integer "max_awakening_level" t.date "release_date" t.date "flb_date" @@ -471,7 +470,7 @@ ActiveRecord::Schema[7.0].define(version: 2025_01_15_094528) do t.date "transcendence_date" t.string "recruits" t.index ["name_en"], name: "index_weapons_on_name_en", opclass: :gin_trgm_ops, using: :gin - t.index ["recruits_id"], name: "index_weapons_on_recruits_id" + t.index ["recruits"], name: "index_weapons_on_recruits" end add_foreign_key "favorites", "parties"