nexus_seed 0.2.5 → 0.2.6

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
  SHA256:
3
- metadata.gz: b7986bc643ea51fe997b278afc18fee2dd4c495f0fb002dac56876d96af707d0
4
- data.tar.gz: 074f92adb8258b0f9ae5589d08b4974a6f4ffc89db0c7afae1391641dadc1b5e
3
+ metadata.gz: 4d134ad4feaf2732ab78c1eb4e452d3e152e05091a6d34050e29b3d72738c919
4
+ data.tar.gz: 5679c7a3a40e6fdbac4d51d2581150f0ddb84766d587d94aeb3c4f42c8698207
5
5
  SHA512:
6
- metadata.gz: ae44a965c6d2cf84bbe3780ee262d4e929b6c1f17bb3f77f9860e3895481581c52fc1d946d45c2650001c61045ddb82d8509bff5e85ca5dc78f16a63a555cbbf
7
- data.tar.gz: cf6fc0c9ab297f02180c56abf45dd86134d0cdacbe8b616b29cdf4d8bbc72c25bf4eb2ae41bc2ded357ab9f924221434c80a68e3a40a2083a0a2c3ee1587b8d7
6
+ metadata.gz: 0ad6d44c43624ab30210f185cd1aa635f9fb864cb751409e2b5a1e851a57dc0220adef961fdf206d96bdbd8854dece8fb545cf4f426949fdbcaf1781ecacc905
7
+ data.tar.gz: 826f3d7549df7df94a73679500e9a937ab5a8623737327df651c7a17329a96b5a37a2bc53f8efff4693cadf9ce14a8b08a19c26a53a19e5e1c5b3ee4b3764173
@@ -9,6 +9,15 @@ module NexusSeed
9
9
  if ENV['destroy_seeds']
10
10
  NexusSeed::Builder.destroy_seeds
11
11
  end
12
+
13
+ # Reset table sequences. Apparently rails looses track of a pk sequence if the pk value is inserted manually, e.g
14
+ # User.new(id: 1).save. When subsequently running User.create(), ActiveRecord should increment the id value to 2
15
+ # by default, but turns out it will try to insert id: 1 again which will result in an error.
16
+ #
17
+ # @todo This "fix" is not ideal and will require more investigation.
18
+ ActiveRecord::Base.connection.tables.each do |t|
19
+ ActiveRecord::Base.connection.reset_pk_sequence!(t)
20
+ end
12
21
  end
13
22
  end
14
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module NexusSeed
3
- # Leave this as 0.2.5 in order for CI process to replace with the tagged version.
4
- VERSION = '0.2.5'
3
+ # Leave this as 0.2.6 in order for CI process to replace with the tagged version.
4
+ VERSION = '0.2.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexus_seed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johnathon Harris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-23 00:00:00.000000000 Z
11
+ date: 2023-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nexus_semantic_logger