From 7b987884b778d7a283ee9ff52122b980506c00b5 Mon Sep 17 00:00:00 2001 From: JP <85654561+jp524@users.noreply.github.com> Date: Sun, 4 May 2025 14:20:31 -0500 Subject: [PATCH] Remove Organization#short_name column --- app/models/organization.rb | 1 - ...04183911_remove_short_name_from_organizations.rb | 13 +++++++++++++ db/schema.rb | 4 +--- spec/factories/organizations.rb | 1 - spec/models/organization_spec.rb | 1 - 5 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20250504183911_remove_short_name_from_organizations.rb diff --git a/app/models/organization.rb b/app/models/organization.rb index a6683f22cd..d89cc66b61 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -23,7 +23,6 @@ # receive_email_on_requests :boolean default(FALSE), not null # reminder_day :integer # repackage_essentials :boolean default(FALSE), not null -# short_name :string # signature_for_distribution_pdf :boolean default(FALSE) # state :string # street :string diff --git a/db/migrate/20250504183911_remove_short_name_from_organizations.rb b/db/migrate/20250504183911_remove_short_name_from_organizations.rb new file mode 100644 index 0000000000..9f318c86c1 --- /dev/null +++ b/db/migrate/20250504183911_remove_short_name_from_organizations.rb @@ -0,0 +1,13 @@ +class RemoveShortNameFromOrganizations < ActiveRecord::Migration[8.0] + def up + safety_assured do + remove_index :organizations, :short_name + remove_column :organizations, :short_name + end + end + + def down + add_column :organizations, :short_name + add_index :organizations, :short_name + end +end diff --git a/db/schema.rb b/db/schema.rb index 230bcef07c..6fa03a5a2a 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[8.0].define(version: 2025_04_04_102321) do +ActiveRecord::Schema[8.0].define(version: 2025_05_04_183911) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" @@ -465,7 +465,6 @@ create_table "organizations", id: :serial, force: :cascade do |t| t.string "name" - t.string "short_name" t.string "email" t.string "url" t.datetime "created_at", precision: nil, null: false @@ -496,7 +495,6 @@ t.boolean "signature_for_distribution_pdf", default: false t.boolean "receive_email_on_requests", default: false, null: false t.index ["latitude", "longitude"], name: "index_organizations_on_latitude_and_longitude" - t.index ["short_name"], name: "index_organizations_on_short_name" end create_table "partner_forms", force: :cascade do |t| diff --git a/spec/factories/organizations.rb b/spec/factories/organizations.rb index f77da8d32c..78d00aa0a6 100644 --- a/spec/factories/organizations.rb +++ b/spec/factories/organizations.rb @@ -23,7 +23,6 @@ # receive_email_on_requests :boolean default(FALSE), not null # reminder_day :integer # repackage_essentials :boolean default(FALSE), not null -# short_name :string # signature_for_distribution_pdf :boolean default(FALSE) # state :string # street :string diff --git a/spec/models/organization_spec.rb b/spec/models/organization_spec.rb index 0627f20a21..8ec57c6c9b 100644 --- a/spec/models/organization_spec.rb +++ b/spec/models/organization_spec.rb @@ -23,7 +23,6 @@ # receive_email_on_requests :boolean default(FALSE), not null # reminder_day :integer # repackage_essentials :boolean default(FALSE), not null -# short_name :string # signature_for_distribution_pdf :boolean default(FALSE) # state :string # street :string