pgslice 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af9d8b9872b5d7331a998243e48e9e9dd4f3a56f
4
- data.tar.gz: edd651dc51c49176345a90515d852a936e8b696e
3
+ metadata.gz: 2d43d6ab9a3394ef28e8db635df3d871224b820b
4
+ data.tar.gz: 20b24a285377ebdd908e08d70d77a53c12e7a8b4
5
5
  SHA512:
6
- metadata.gz: e521baa2ab4d83fbaff40781b1b1a0e49500ca0cc5d1a37a2decb9764f7cc7f2568815961b6212a7e6e0665c83a8ac42d642261d702ed34a3ef454a57341bf5f
7
- data.tar.gz: 66d0e6a38534f4e15ac6d607958823ca4b55ccad80be22351fa7c7085121d049583254e1637e051020e4190622e9a8d2e03bad0dc06cdd8dd8908a44331cd425
6
+ metadata.gz: 9e595c90abf4444c538c23b62fc52592f6095ceb5ddc715c6d537c87b337e1bd7663f794364d080edb9943041f98fd93cdadb434ce5976746ad01348225e48a8
7
+ data.tar.gz: 4e4081d488e8f024f0ce3f47f238657debb69b1418194ca0562814aa2825a0e9527848cab90c91b93d984a90692a0b56310e55a01578d38a738fcfb33f80513a
@@ -1,3 +1,8 @@
1
+ ## 0.3.2
2
+
3
+ - Exit with error code on interrupt
4
+ - Fixed `--start` option with `--swapped`
5
+
1
6
  ## 0.3.1
2
7
 
3
8
  - Fixed exception with `--no-partition` option
@@ -6,5 +6,5 @@ begin
6
6
  rescue PgSlice::Error => e
7
7
  abort e.message
8
8
  rescue Interrupt => e
9
- # do nothing
9
+ abort
10
10
  end
@@ -243,20 +243,19 @@ CREATE OR REPLACE FUNCTION #{trigger_name}()
243
243
 
244
244
  primary_key = self.primary_key(table)
245
245
  max_source_id = max_id(source_table, primary_key)
246
+
246
247
  max_dest_id =
247
- if options[:swapped]
248
+ if options[:start]
249
+ options[:start]
250
+ elsif options[:swapped]
248
251
  max_id(dest_table, primary_key, where: options[:where], below: max_source_id)
249
252
  else
250
253
  max_id(dest_table, primary_key, where: options[:where])
251
254
  end
252
255
 
253
256
  if max_dest_id == 0 && !options[:swapped]
254
- if options[:start]
255
- max_dest_id = options[:start]
256
- else
257
- min_source_id = min_id(source_table, primary_key, field, cast, starting_time, options[:where])
258
- max_dest_id = min_source_id - 1 if min_source_id
259
- end
257
+ min_source_id = min_id(source_table, primary_key, field, cast, starting_time, options[:where])
258
+ max_dest_id = min_source_id - 1 if min_source_id
260
259
  end
261
260
 
262
261
  starting_id = max_dest_id
@@ -1,3 +1,3 @@
1
1
  module PgSlice
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgslice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-14 00:00:00.000000000 Z
11
+ date: 2016-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop