From dd213e80788883c2c678dfc70c7d69451779d978 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Fri, 15 Nov 2024 19:29:13 -0800 Subject: [PATCH] Increase the maximum value for pet types' color ID and species ID Oh dang, we're on color #120 now, and looks like our maximum value is 127. Let's expand that! I noticed this because I'm writing tests for some stuff, and used "456" as a placeholder ID number, and it just fully did not work, and I'm like. Oh. --- ...se_pet_type_color_id_and_species_id_limit.rb | 17 +++++++++++++++++ db/schema.rb | 6 +++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20241116031655_increase_pet_type_color_id_and_species_id_limit.rb diff --git a/db/migrate/20241116031655_increase_pet_type_color_id_and_species_id_limit.rb b/db/migrate/20241116031655_increase_pet_type_color_id_and_species_id_limit.rb new file mode 100644 index 00000000..d43fbf1c --- /dev/null +++ b/db/migrate/20241116031655_increase_pet_type_color_id_and_species_id_limit.rb @@ -0,0 +1,17 @@ +class IncreasePetTypeColorIdAndSpeciesIdLimit < ActiveRecord::Migration[7.2] + def change + reversible do |direction| + change_table :pet_types do |t| + direction.up do + t.change :color_id, :integer, null: false + t.change :species_id, :integer, null: false + end + + direction.down do + t.change :color_id, :integer, limit: 1, null: false + t.change :species_id, :integer, limit: 1, null: false + end + end + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 71ef6512..4d2b6e72 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.2].define(version: 2024_10_08_004715) do +ActiveRecord::Schema[7.2].define(version: 2024_11_16_031655) do create_table "alt_styles", charset: "utf8mb4", collation: "utf8mb4_unicode_520_ci", force: :cascade do |t| t.integer "species_id", null: false t.integer "color_id", null: false @@ -225,8 +225,8 @@ ActiveRecord::Schema[7.2].define(version: 2024_10_08_004715) do end create_table "pet_types", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_520_ci", force: :cascade do |t| - t.integer "color_id", limit: 1, null: false - t.integer "species_id", limit: 1, null: false + t.integer "color_id", null: false + t.integer "species_id", null: false t.datetime "created_at", precision: nil, null: false t.integer "body_id", limit: 2, null: false t.string "image_hash", limit: 8