From 07617fa34f71f865366fe380a872303534a965c3 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Sun, 24 Mar 2024 11:09:40 +1100 Subject: [PATCH] Increase ID column limit for item_outfit_relationships Ahh wow, we're finally at the point of having enough outfits to need to increase this ID field! I got an alert this morning that queries were failing with the MySQL error "id out of range". I went and found that creating a new outfit still works if it's empty, but fails once you try to add an item to it. So, I assume this is the failing column! Note that I'm writing this from my emergency Steam Deck workstation, and that I didn't quite get MySQL set up on it yet (I just yolo ran this in production), so we don't have the corresponding changes to `db/schema.rb` yet. This might require another commit from my normal workstation later to complete this change! --- ..._increase_limit_for_item_outfit_relationships_id.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 db/migrate/20240323234243_increase_limit_for_item_outfit_relationships_id.rb diff --git a/db/migrate/20240323234243_increase_limit_for_item_outfit_relationships_id.rb b/db/migrate/20240323234243_increase_limit_for_item_outfit_relationships_id.rb new file mode 100644 index 00000000..e49ab897 --- /dev/null +++ b/db/migrate/20240323234243_increase_limit_for_item_outfit_relationships_id.rb @@ -0,0 +1,10 @@ +class IncreaseLimitForItemOutfitRelationshipsId < ActiveRecord::Migration[7.1] + def change + reversible do |direction| + change_table :item_outfit_relationships do |t| + direction.up { t.change :id, :integer, limit: 8 } + direction.down{ t.change :id, :integer, limit: 4 } + end + end + end +end