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.
This commit is contained in:
evazion
2022-01-06 11:37:48 -06:00
parent 080dbf5a8c
commit e8c52432a4
2 changed files with 12 additions and 7 deletions

View File

@@ -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

View File

@@ -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');