From c9902fce6a9d49cdd0abaaf86e33b2a02be8b166 Mon Sep 17 00:00:00 2001 From: Dhanujha R Date: Mon, 26 Jun 2023 20:06:33 +0530 Subject: [PATCH] Remove deprecated Organization's columns (#19396) Co-authored-by: Lawrence Co-authored-by: Mac Siri Co-authored-by: Rajat Talesra Co-authored-by: Mac Siri --- app/serializers/search/organization_serializer.rb | 2 +- .../20230407215100_remove_nav_image_from_organizations.rb | 6 ++++++ db/schema.rb | 2 -- spec/serializers/search/organization_serializer_spec.rb | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20230407215100_remove_nav_image_from_organizations.rb diff --git a/app/serializers/search/organization_serializer.rb b/app/serializers/search/organization_serializer.rb index 0345c043d..8a37a6242 100644 --- a/app/serializers/search/organization_serializer.rb +++ b/app/serializers/search/organization_serializer.rb @@ -1,6 +1,6 @@ module Search class OrganizationSerializer < ApplicationSerializer attribute :class_name, -> { "Organization" } - attributes :id, :name, :summary, :profile_image, :twitter_username, :nav_image, :slug + attributes :id, :name, :summary, :profile_image, :twitter_username, :slug end end diff --git a/db/migrate/20230407215100_remove_nav_image_from_organizations.rb b/db/migrate/20230407215100_remove_nav_image_from_organizations.rb new file mode 100644 index 000000000..349845532 --- /dev/null +++ b/db/migrate/20230407215100_remove_nav_image_from_organizations.rb @@ -0,0 +1,6 @@ +class RemoveNavImageFromOrganizations < ActiveRecord::Migration[7.0] + def change + safety_assured { remove_column :organizations, :nav_image, :string } + safety_assured { remove_column :organizations, :dark_nav_image, :string } + end + end \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index edb984971..5d3b29049 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -704,14 +704,12 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_22_151553) do t.string "cta_button_text" t.string "cta_button_url" t.text "cta_processed_html" - t.string "dark_nav_image" t.string "email" t.string "github_username" t.datetime "last_article_at", precision: nil, default: "2017-01-01 05:00:00" t.datetime "latest_article_updated_at", precision: nil t.string "location" t.string "name" - t.string "nav_image" t.string "old_old_slug" t.string "old_slug" t.string "profile_image" diff --git a/spec/serializers/search/organization_serializer_spec.rb b/spec/serializers/search/organization_serializer_spec.rb index 255344f46..685ba786d 100644 --- a/spec/serializers/search/organization_serializer_spec.rb +++ b/spec/serializers/search/organization_serializer_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Search::OrganizationSerializer do it "serializes a organization" do data_hash = described_class.new(organization).serializable_hash.dig(:data, :attributes) - expect(data_hash.keys).to include(:id, :name, :summary, :profile_image, :twitter_username, :nav_image, :slug) + expect(data_hash.keys).to include(:id, :name, :summary, :profile_image, :twitter_username, :slug) expect(data_hash[:id]).to eq(organization.id) expect(data_hash[:name]).to eq(organization.name) expect(data_hash[:profile_image]).to eq(organization.profile_image)