From e8c52432a4bac02c68a553847f85311ef8b337d8 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 6 Jan 2022 11:37:48 -0600 Subject: [PATCH] db: remove unused columns on posts table. is_note_locked, is_rating_locked, and is_status_locked have been unused since 126046cb6. tag_index has been unused since 37a8dc5db. fav_string has been unused since 165339236. pool_string has been unused since 7d503f088. --- db/migrate/20220106172910_drop_unused_post_columns.rb | 10 ++++++++++ db/structure.sql | 9 ++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 db/migrate/20220106172910_drop_unused_post_columns.rb diff --git a/db/migrate/20220106172910_drop_unused_post_columns.rb b/db/migrate/20220106172910_drop_unused_post_columns.rb new file mode 100644 index 000000000..0696c37f8 --- /dev/null +++ b/db/migrate/20220106172910_drop_unused_post_columns.rb @@ -0,0 +1,10 @@ +class DropUnusedPostColumns < ActiveRecord::Migration[6.1] + def change + remove_column :posts, :is_note_locked, :boolean, default: false, null: false + remove_column :posts, :is_rating_locked, :boolean, default: false, null: false + remove_column :posts, :is_status_locked, :boolean, default: false, null: false + remove_column :posts, :tag_index, :tsvector + remove_column :posts, :fav_string, :text, default: "", null: false + remove_column :posts, :pool_string, :text, default: "", null: false + end +end diff --git a/db/structure.sql b/db/structure.sql index 9431622b3..690c113b3 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -865,23 +865,17 @@ CREATE TABLE public.posts ( image_height integer NOT NULL, uploader_ip_addr inet NOT NULL, tag_string text DEFAULT ''::text NOT NULL, - is_note_locked boolean DEFAULT false NOT NULL, fav_count integer DEFAULT 0 NOT NULL, file_ext character varying NOT NULL, last_noted_at timestamp without time zone, - is_rating_locked boolean DEFAULT false NOT NULL, parent_id integer, has_children boolean DEFAULT false NOT NULL, approver_id integer, - tag_index tsvector, tag_count_general integer DEFAULT 0 NOT NULL, tag_count_artist integer DEFAULT 0 NOT NULL, tag_count_character integer DEFAULT 0 NOT NULL, tag_count_copyright integer DEFAULT 0 NOT NULL, file_size integer NOT NULL, - is_status_locked boolean DEFAULT false NOT NULL, - fav_string text DEFAULT ''::text NOT NULL, - pool_string text DEFAULT ''::text NOT NULL, up_score integer DEFAULT 0 NOT NULL, down_score integer DEFAULT 0 NOT NULL, is_pending boolean DEFAULT false NOT NULL, @@ -5059,6 +5053,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20211121080239'), ('20220101224048'), ('20220104214319'), -('20220106171727'); +('20220106171727'), +('20220106172910');