Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pkg
/.idea
30 changes: 15 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
PATH
remote: .
specs:
activerecord-clean-db-structure (0.2.0)
activerecord-clean-db-structure (0.2.1)
activerecord (>= 4.2)

GEM
remote: https://rubygems.org/
specs:
activemodel (5.0.1)
activesupport (= 5.0.1)
activerecord (5.0.1)
activemodel (= 5.0.1)
activesupport (= 5.0.1)
arel (~> 7.0)
activesupport (5.0.1)
activemodel (5.1.2)
activesupport (= 5.1.2)
activerecord (5.1.2)
activemodel (= 5.1.2)
activesupport (= 5.1.2)
arel (~> 8.0)
activesupport (5.1.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.4)
concurrent-ruby (1.0.4)
i18n (0.8.0)
minitest (5.10.1)
thread_safe (0.3.5)
tzinfo (1.2.2)
arel (8.0.0)
concurrent-ruby (1.0.5)
i18n (0.8.4)
minitest (5.10.2)
thread_safe (0.3.6)
tzinfo (1.2.3)
thread_safe (~> 0.1)

PLATFORMS
Expand All @@ -33,4 +33,4 @@ DEPENDENCIES
activerecord-clean-db-structure!

BUNDLED WITH
1.12.5
1.15.1
10 changes: 10 additions & 0 deletions lib/activerecord-clean-db-structure/clean_dump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ def run
# Remove useless comment lines
dump.gsub!(/^--$/, '')

# Mask user mapping
dump.gsub!(
/^CREATE USER MAPPING FOR \w+ SERVER (\w+) .*;/m,
'CREATE USER MAPPING FOR some_user SERVER \1;'
)
dump.gsub!(
/^-- Name: USER MAPPING \w+ SERVER (\w+); Type: USER MAPPING/,
'-- Name: USER MAPPING some_user SERVER \1; Type: USER MAPPING'
)

# Reduce noise for id fields by making them SERIAL instead of integer+sequence stuff
#
# This is a bit optimistic, but works as long as you don't have an id field thats not a sequence/uuid
Expand Down
2 changes: 1 addition & 1 deletion lib/activerecord-clean-db-structure/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ActiveRecordCleanDbStructure
VERSION = '0.2.0'
VERSION = '0.2.1'
end