From 09445cb28b3f3b78dc3abdff4c1a77afca1d794c Mon Sep 17 00:00:00 2001 From: BrokenEagle Date: Wed, 18 Mar 2020 22:56:38 +0000 Subject: [PATCH] Drop unused BUR title column --- app/models/bulk_update_request.rb | 4 ++-- app/views/bulk_update_requests/_search.html.erb | 1 - .../20200318224633_drop_title_from_bulk_update_requests.rb | 5 +++++ db/structure.sql | 6 +++--- 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20200318224633_drop_title_from_bulk_update_requests.rb diff --git a/app/models/bulk_update_request.rb b/app/models/bulk_update_request.rb index 9ad1516dd..c7d77d458 100644 --- a/app/models/bulk_update_request.rb +++ b/app/models/bulk_update_request.rb @@ -1,4 +1,5 @@ class BulkUpdateRequest < ApplicationRecord + attr_accessor :title attr_accessor :reason attr_reader :skip_secondary_validations @@ -33,8 +34,7 @@ class BulkUpdateRequest < ApplicationRecord def search(params = {}) q = super - q = q.search_attributes(params, :user, :approver, :forum_topic_id, :forum_post_id, :title, :script) - q = q.text_attribute_matches(:title, params[:title_matches]) + q = q.search_attributes(params, :user, :approver, :forum_topic_id, :forum_post_id, :script) q = q.text_attribute_matches(:script, params[:script_matches]) if params[:status].present? diff --git a/app/views/bulk_update_requests/_search.html.erb b/app/views/bulk_update_requests/_search.html.erb index d95e40f05..f00126150 100644 --- a/app/views/bulk_update_requests/_search.html.erb +++ b/app/views/bulk_update_requests/_search.html.erb @@ -1,7 +1,6 @@ <%= search_form_for(bulk_update_requests_path) do |f| %> <%= f.input :user_name, label: "Creator", input_html: { value: params[:search][:user_name], data: { autocomplete: "user" } } %> <%= f.input :approver_name, label: "Approver", input_html: { value: params[:search][:approver_name], data: { autocomplete: "user" } } %> - <%= f.input :title_matches, label: "Title", input_html: { value: params[:search][:title_matches] } %> <%= f.input :script_matches, label: "Script", input_html: { value: params[:search][:script_matches] } %> <%= f.input :status, label: "Status", collection: %w[pending approved rejected], include_blank: true, selected: params[:search][:status] %> <%= f.input :order, collection: [%w[Status status_desc], %w[Last\ updated updated_at_desc], %w[Newest id_desc], %w[Oldest id_asc]], include_blank: false, selected: params[:search][:order] %> diff --git a/db/migrate/20200318224633_drop_title_from_bulk_update_requests.rb b/db/migrate/20200318224633_drop_title_from_bulk_update_requests.rb new file mode 100644 index 000000000..d75c17852 --- /dev/null +++ b/db/migrate/20200318224633_drop_title_from_bulk_update_requests.rb @@ -0,0 +1,5 @@ +class DropTitleFromBulkUpdateRequests < ActiveRecord::Migration[6.0] + def change + remove_column :bulk_update_requests, :title, :text, null: false, default: "" + end +end diff --git a/db/structure.sql b/db/structure.sql index 505b3fc9e..ea2a670d6 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -669,8 +669,7 @@ CREATE TABLE public.bulk_update_requests ( created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, approver_id integer, - forum_post_id integer, - title text + forum_post_id integer ); @@ -7370,6 +7369,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200306202253'), ('20200307021204'), ('20200309035334'), -('20200309043653'); +('20200309043653'), +('20200318224633');