capistrano3-postgres 0.2.3 → 0.2.4

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: c92f08b1a9d787c0bf7547c8b71317478280bbff
4
- data.tar.gz: e1553241ac3a947e454062fd375d33d0e94ea8ff
3
+ metadata.gz: 4e80a92bd0f933cc263c8a2147450b111c4aa47d
4
+ data.tar.gz: bc269fdedb5ae903c724e822dab203bdf52850bc
5
5
  SHA512:
6
- metadata.gz: fc43efb7a94ba93e0de194ce2a2244c96fb072ae80918bfbd56c521ee756235c0789c61db8c7e3a8ab2b315fdd5705863aaee95fc434ff27feffd3f9b7a1dd99
7
- data.tar.gz: cd3e6bc1eb5d4233127ce284fdafda5ebca291cfab7f45af1d553825879e3030d4b9f975504fa1f27dda5c95909f2f16916a0a9e8a62e82855120dd168d81e9a
6
+ metadata.gz: 1d2556abe85c3a4f1d0391aa672654e258ee6464b882c462c002d975673c588e46fb5f9008f73e6d3a233a36ed1a2824c91448b4f232e47e3debb637ae78bfd9
7
+ data.tar.gz: 14377d6bc96bae2775703a212d1e6bf45a95e3bf337c7ac54ac1efba437313f906de852c473759eefdaf40660bac976bda41184a51bcf80ea8c9d47d5b850da0
data/README.md CHANGED
@@ -61,6 +61,19 @@ If you are using different clusters:
61
61
  set :postgres_remote_cluster, '9.6/main'
62
62
  ```
63
63
 
64
+ If you don't need one or more tables dumped:
65
+
66
+ ```
67
+ set :postgres_backup_exclude_table, ['personal_data', 'logs'] # Will not dump tables
68
+ set :postgres_backup_exclude_table_data, -> { ['personal_data', 'logs'] } # Will not dump data for this tables
69
+ ```
70
+
71
+ If you need only specific tables to be dumped:
72
+
73
+ ```
74
+ set :postgres_backup_table, -> { ['users', 'orders'] }
75
+ ```
76
+
64
77
  ## Contributing
65
78
 
66
79
  1. Fork it ( http://github.com/spilin/capistrano3-postgres/fork )
@@ -1,5 +1,5 @@
1
1
  module Capistrano3
2
2
  module Postgres
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  end
@@ -9,6 +9,9 @@ namespace :load do
9
9
  set :postgres_local_database_config, -> { nil }
10
10
  set :postgres_remote_database_config, -> { nil }
11
11
  set :postgres_remote_cluster, -> { nil }
12
+ set :postgres_backup_exclude_table_data, -> { [] }
13
+ set :postgres_backup_exclude_table, -> { [] }
14
+ set :postgres_backup_table, -> { [] }
12
15
  end
13
16
  end
14
17
 
@@ -32,9 +35,12 @@ namespace :postgres do
32
35
  "-Fc",
33
36
  "--file=#{fetch(:postgres_remote_sqlc_file_path)}",
34
37
  "-Z #{fetch(:postgres_backup_compression_level)}",
38
+ fetch(:postgres_backup_exclude_table_data).map {|table| "--exclude-table-data=#{table}" },
39
+ fetch(:postgres_backup_exclude_table).map {|table| "--exclude-table=#{table}" },
40
+ fetch(:postgres_backup_table).map {|table| "--table=#{table}" },
35
41
  fetch(:postgres_remote_cluster) ? "--cluster #{fetch(:postgres_remote_cluster)}" : nil,
36
42
  "#{config['database']}"
37
- ].compact.join(' ')
43
+ ].flatten.compact.join(' ')
38
44
  end
39
45
  end
40
46
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano3-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Krasynskyi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-23 00:00:00.000000000 Z
11
+ date: 2018-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  version: '0'
62
62
  requirements: []
63
63
  rubyforge_project:
64
- rubygems_version: 2.6.10
64
+ rubygems_version: 2.4.5.1
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: Create, download and restore postgres database.