Skip to content

Commit

Permalink
Drop old user image columns
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jul 17, 2019
1 parent 826b70f commit 8a39c6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 0 additions & 2 deletions app/models/user.rb
Expand Up @@ -46,8 +46,6 @@
class User < ActiveRecord::Base
require "xml/libxml"

self.ignored_columns = %w[image_file_name image_fingerprint image_content_type]

has_many :traces, -> { where(:visible => true) }
has_many :diary_entries, -> { order(:created_at => :desc) }
has_many :diary_comments, -> { order(:created_at => :desc) }
Expand Down
9 changes: 9 additions & 0 deletions db/migrate/20190716173946_remove_user_images.rb
@@ -0,0 +1,9 @@
class RemoveUserImages < ActiveRecord::Migration[5.2]
def change
safety_assured do
remove_column :users, :image_file_name, :image
remove_column :users, :image_fingerprint, :string
remove_column :users, :image_content_type, :string
end
end
end
4 changes: 1 addition & 3 deletions db/structure.sql
Expand Up @@ -1343,7 +1343,6 @@ CREATE TABLE public.users (
home_zoom smallint DEFAULT 3,
nearby integer DEFAULT 50,
pass_salt character varying,
image_file_name text,
email_valid boolean DEFAULT false NOT NULL,
new_email character varying,
creation_ip character varying,
Expand All @@ -1355,12 +1354,10 @@ CREATE TABLE public.users (
preferred_editor character varying,
terms_seen boolean DEFAULT false NOT NULL,
description_format public.format_enum DEFAULT 'markdown'::public.format_enum NOT NULL,
image_fingerprint character varying,
changesets_count integer DEFAULT 0 NOT NULL,
traces_count integer DEFAULT 0 NOT NULL,
diary_entries_count integer DEFAULT 0 NOT NULL,
image_use_gravatar boolean DEFAULT false NOT NULL,
image_content_type character varying,
auth_provider character varying,
home_tile bigint,
tou_agreed timestamp without time zone
Expand Down Expand Up @@ -3086,6 +3083,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20190518115041'),
('20190623093642'),
('20190702193519'),
('20190716173946'),
('21'),
('22'),
('23'),
Expand Down

0 comments on commit 8a39c6b

Please sign in to comment.