From a5fbadda1d491db675c1e49eb1af3f561bcb7c08 Mon Sep 17 00:00:00 2001 From: Geoff Ereth Date: Fri, 1 Mar 2019 13:58:32 -0800 Subject: [PATCH] Adds pg comments for fake_pipe --- Gemfile | 2 + Gemfile.lock | 9 +++ ...1200609_adds_comments_for_anonymization.rb | 16 +++++ db/structure.sql | 72 +++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 db/migrate/20190301200609_adds_comments_for_anonymization.rb diff --git a/Gemfile b/Gemfile index 77a34a0a90..4ea00da11f 100644 --- a/Gemfile +++ b/Gemfile @@ -129,6 +129,8 @@ group :development do # gem 'test-unit', '~> 3.0' gem 'rerun' gem 'bullet' + gem 'fake_pipe' + gem 'migration_comments' # gem 'pry-rails' end diff --git a/Gemfile.lock b/Gemfile.lock index db52bc8b69..fb88a52597 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -138,6 +138,11 @@ GEM factory_bot_rails (4.11.1) factory_bot (~> 4.11.1) railties (>= 3.0.0) + fake_pipe (0.2.3) + activesupport + faker + faker (1.9.3) + i18n (>= 0.7) faraday (0.9.2) multipart-post (>= 1.2, < 3) fast_blank (1.0.0) @@ -261,6 +266,8 @@ GEM mini_mime (>= 0.1.1) memory_profiler (0.9.6) method_source (0.9.2) + migration_comments (0.4.1) + activerecord (>= 4.2.0) mime-types (3.2.2) mime-types-data (~> 3.2015) mime-types-data (3.2018.0812) @@ -581,6 +588,7 @@ DEPENDENCIES draper eventmachine factory_bot_rails + fake_pipe fast_blank (~> 1.0) flamegraph fog-aws @@ -609,6 +617,7 @@ DEPENDENCIES lograge logstash-event memory_profiler + migration_comments mini_magick money-rails nokogiri (~> 1.8.1) diff --git a/db/migrate/20190301200609_adds_comments_for_anonymization.rb b/db/migrate/20190301200609_adds_comments_for_anonymization.rb new file mode 100644 index 0000000000..87bd225b44 --- /dev/null +++ b/db/migrate/20190301200609_adds_comments_for_anonymization.rb @@ -0,0 +1,16 @@ +class AddsCommentsForAnonymization < ActiveRecord::Migration + def change + change_table :bikes do |t| + t.change_comment :name, "anon: lorem_word" + t.change_comment :serial_number, "anon: ugcid" + t.change_comment :owner_email, "anon: email" + t.change_comment :cached_data, "anon: lorem_sentence" + t.change_comment :description, "anon: lorem_sentence" + t.change_comment :pdf, "anon: lorem_word" + t.change_comment :serial_normalized, "anon: ugcid" + t.change_comment :all_description, "anon: ugcid" + t.change_comment :stolen_lat, "anon: latitude" + t.change_comment :stolen_long, "anon: longitude" + end + end +end diff --git a/db/structure.sql b/db/structure.sql index 504a74b148..d5bf984b1b 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -265,6 +265,76 @@ CREATE TABLE public.bikes ( ); +-- +-- Name: COLUMN bikes.name; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.bikes.name IS 'anon: lorem_word'; + + +-- +-- Name: COLUMN bikes.serial_number; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.bikes.serial_number IS 'anon: ugcid'; + + +-- +-- Name: COLUMN bikes.cached_data; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.bikes.cached_data IS 'anon: lorem_sentence'; + + +-- +-- Name: COLUMN bikes.description; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.bikes.description IS 'anon: lorem_sentence'; + + +-- +-- Name: COLUMN bikes.owner_email; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.bikes.owner_email IS 'anon: email'; + + +-- +-- Name: COLUMN bikes.pdf; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.bikes.pdf IS 'anon: lorem_word'; + + +-- +-- Name: COLUMN bikes.serial_normalized; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.bikes.serial_normalized IS 'anon: ugcid'; + + +-- +-- Name: COLUMN bikes.all_description; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.bikes.all_description IS 'anon: ugcid'; + + +-- +-- Name: COLUMN bikes.stolen_lat; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.bikes.stolen_lat IS 'anon: latitude'; + + +-- +-- Name: COLUMN bikes.stolen_long; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.bikes.stolen_long IS 'anon: longitude'; + + -- -- Name: bikes_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- @@ -4113,3 +4183,5 @@ INSERT INTO schema_migrations (version) VALUES ('20190208195902'); INSERT INTO schema_migrations (version) VALUES ('20190301020053'); +INSERT INTO schema_migrations (version) VALUES ('20190301200609'); +