db-clone 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c090e84df3d16883f1600d89227986469a2daff1
4
- data.tar.gz: 23b0f66de665e22a2f3c3cda6b16307bfde989da
3
+ metadata.gz: 0b5b95c07deaed846e15c2316eda7101833acdfb
4
+ data.tar.gz: 512399b9b7471805f42e0f4d819363334ad67091
5
5
  SHA512:
6
- metadata.gz: 7e9d7498cce799c664c36c79da2705cb706d74828be76d1e6c88be24d2d05ecc2204ba5b7b5c9815d90da9d12cd907fcc6099ff4c601a593d79f5db12896b7d0
7
- data.tar.gz: 841edcf55819ac435c93cb45aa8727575efa936a1d61544de7f870c16c8f139dd5fb37b5a20078f4cddb7893bae28132808c382d619afd974d448d46c042854a
6
+ metadata.gz: 9c83fdd42b1ccb598dc1aa20ce78256a2fbfc93851924880a25b6ffc6eb1db5f45a662e55ed3499b43fdd90c95dfb4b0ff9a6f5f42740f0b68d49973663406e0
7
+ data.tar.gz: 82b4e8cbbc5bdfa4e531842ccb8a97a7f99d7a3ad7dad9df67d0e5d78e5a5f3aa33c879db83e9e4280222ba521886aee867a031caf49cec9c8aef078296b52a4
data/README.md CHANGED
@@ -16,7 +16,7 @@ db-clone requires `mysqldump` (for MySQL) and/or `pg_dump` (for PostgreSQL).
16
16
 
17
17
  ## Installation
18
18
 
19
- Add to `gem 'db-clone', '~> 2.0', '>= 2.0.1'` to your `Gemfile` and `bundle install`.
19
+ Add `gem 'db-clone', '~> 2.1'` to your `Gemfile` and `bundle install`.
20
20
 
21
21
  ## Usage
22
22
 
@@ -47,7 +47,7 @@ Db::Clone.setup do |config|
47
47
  # default is 'development'
48
48
  config.default_destination_database = 'my_destination_db'
49
49
 
50
- # default is [], adds --ignore-table arguments to mysqldump
50
+ # default is [], adds --ignore-table arguments to mysqldump or --exclude-table arguments to pg_dump
51
51
  config.ignore_tables = ['schema_migrations', 'some_other_table']
52
52
  end
53
53
  ```
@@ -40,18 +40,23 @@ module Db
40
40
  end
41
41
 
42
42
  def build_postgresql_cmd src_dest
43
- [
43
+ pg_dump_args = [
44
44
  "pg_dump --no-password --clean",
45
45
  "--host=#{src_dest[:src]['host']}",
46
46
  "--port=#{src_dest[:src]['port']}",
47
47
  "--username=#{src_dest[:src]['username']}",
48
+ ]
49
+
50
+ Db::Clone.ignore_tables.each{|tbl| pg_dump_args << "--exclude-table=#{tbl}"}
51
+
52
+ (pg_dump_args + [
48
53
  "#{src_dest[:src]['database']}",
49
54
  "| psql",
50
55
  "--host=#{src_dest[:dest]['host']}",
51
56
  "--port=#{src_dest[:dest]['port']}",
52
57
  "--username=#{src_dest[:dest]['username']}",
53
58
  "#{src_dest[:dest]['database']}"
54
- ].join(' ')
59
+ ]).join(' ')
55
60
  end
56
61
  end
57
62
  end
@@ -1,5 +1,5 @@
1
1
  module Db
2
2
  module Clone
3
- VERSION = '2.0.1'
3
+ VERSION = '2.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db-clone
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Huber
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-02 00:00:00.000000000 Z
11
+ date: 2017-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize