db-purger 0.2.10 → 0.4.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
  SHA256:
3
- metadata.gz: 2fc223dbeccc5fbcaa19d25e1c2a63741e15ce013d07a99d33c6fe4d2b95f220
4
- data.tar.gz: 834d39435ebd2c96dafe5158a38e48930bc75bcf64b785cbf60b13184cdca69d
3
+ metadata.gz: 4025ea48c6e9d97505720a8450017e70f2fd527408b518cc8837ddf512ce043d
4
+ data.tar.gz: 3cb576faf87f8a5d2735fd8edc973e04063469a7edae92148dac7d7a80688be1
5
5
  SHA512:
6
- metadata.gz: 2c6a503a148ed02a2e1d852d28c930b7801fba387352ff2c825dab45cef2706e8715461842f8ea4e55c45b7a0ba56e72fe96ab9685e8a928f3a8920aa9b3644c
7
- data.tar.gz: 6518a0adbf0cd1594c3f2ae9c0eed233fb0648a55c5981a8319f135c7f1f00455fbbc2b6d5b21f29f82855c9b3ecf37e4c145b13c6bd30c658016f20ffa05c06
6
+ metadata.gz: 3685ddf0b11aff29c97d618026abe46a59c1d21a8310f6d8c038f913b2892e30b77468c1d5d8946978eaf14e4003278815967417e7ec5ec98cc0257b00dbce84
7
+ data.tar.gz: b6dacd558e0b1a7b4b22c9ed332df7071da6300e43e9eb0476cbcf32899c998c39197aad7005e78e38f86ed821d728bf61e8f9d62fe945695987abe614443d0e
@@ -44,8 +44,8 @@ module DBPurger
44
44
  end
45
45
 
46
46
  def output_plan_errors
47
- plan_validator.errors.each do |field, error_msg|
48
- @error_io.puts "#{field}: #{error_msg}"
47
+ plan_validator.errors.each do |error|
48
+ @error_io.puts "#{error.attribute}: #{error.type}"
49
49
  end
50
50
  end
51
51
  end
@@ -11,6 +11,10 @@ module DBPurger
11
11
  metrics.reset!
12
12
  end
13
13
 
14
+ def self.finished!
15
+ metrics.finished!
16
+ end
17
+
14
18
  def self.auto_attach
15
19
  attach_to :db_purger
16
20
  end
@@ -19,7 +19,9 @@ module DBPurger
19
19
 
20
20
  def purge!(database, purge_value)
21
21
  MetricSubscriber.reset!
22
- PurgeTable.new(database, @base_table, @base_table.field, purge_value).purge!
22
+ num_deleted = PurgeTable.new(database, @base_table, @base_table.field, purge_value).purge!
23
+ MetricSubscriber.finished!
24
+ num_deleted
23
25
  end
24
26
 
25
27
  def tables
@@ -47,6 +47,7 @@ module DBPurger
47
47
  purge_nested_tables(batch) if @table.nested_tables?
48
48
  delete_records(batch)
49
49
  end
50
+ purge_parent_tables
50
51
  end
51
52
 
52
53
  def next_batch(start_id)
@@ -11,7 +11,6 @@ module DBPurger
11
11
 
12
12
  def purge_nested_tables(batch)
13
13
  purge_child_tables(batch) unless @table.nested_plan.child_tables.empty?
14
- purge_parent_tables
15
14
  end
16
15
 
17
16
  def purge_child_tables(batch)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db-purger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-27 00:00:00.000000000 Z
11
+ date: 2022-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynamic-active-model
@@ -61,7 +61,7 @@ homepage: https://github.com/dougyouch/db-purger
61
61
  licenses:
62
62
  - MIT
63
63
  metadata: {}
64
- post_install_message:
64
+ post_install_message:
65
65
  rdoc_options: []
66
66
  require_paths:
67
67
  - lib
@@ -76,8 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 3.0.3
80
- signing_key:
79
+ rubygems_version: 3.2.3
80
+ signing_key:
81
81
  specification_version: 4
82
82
  summary: DB Purger by top level id
83
83
  test_files: []