sample_data_dump_postgres_data_store 0.0.3 → 0.0.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d8a276f15201c22d81c1f18ee982c603d4cc990
|
4
|
+
data.tar.gz: 24e6ba2621388ddf9d5240bb8127c4251e21aaf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e814651e54f2534bf09d148f1e7e74fd3c53b8704fc9976a889ce7d1a55d1c84259bcf17cd741b745fb677636536cdd4595f4091e901a03b33378f663de88385
|
7
|
+
data.tar.gz: de06dde145eebab4a1e9ad02f3fa870bbe4d735a5c3464aed308ae628ce500a19fb6ae0e12a575167068b27fa1bd4104e90d51e68a8235ff4e247f8deafcee8e
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sample_data_dump_postgres_data_store (0.0.
|
4
|
+
sample_data_dump_postgres_data_store (0.0.4)
|
5
5
|
activerecord
|
6
6
|
dry-matcher
|
7
7
|
dry-monads
|
@@ -156,7 +156,7 @@ GEM
|
|
156
156
|
rake (>= 0.8.7)
|
157
157
|
thor (>= 0.19.0, < 2.0)
|
158
158
|
rainbow (3.0.0)
|
159
|
-
rake (12.3.
|
159
|
+
rake (12.3.2)
|
160
160
|
rb-fsevent (0.10.3)
|
161
161
|
rb-inotify (0.9.10)
|
162
162
|
ffi (>= 0.5.0, < 2)
|
@@ -179,7 +179,7 @@ GEM
|
|
179
179
|
diff-lcs (>= 1.2.0, < 2.0)
|
180
180
|
rspec-support (~> 3.8.0)
|
181
181
|
rspec-support (3.8.0)
|
182
|
-
rubocop (0.
|
182
|
+
rubocop (0.61.1)
|
183
183
|
jaro_winkler (~> 1.5.1)
|
184
184
|
parallel (~> 1.10)
|
185
185
|
parser (>= 2.5, != 2.5.1.1)
|
@@ -42,8 +42,14 @@ module SampleDataDumpPostgresDataStore
|
|
42
42
|
|
43
43
|
def reset_sequence(table_configuration)
|
44
44
|
table_name = table_configuration.qualified_table_name
|
45
|
-
|
46
|
-
@postgresql_adapter.execute(
|
45
|
+
get_sequence_name_sql = "SELECT PG_GET_SERIAL_SEQUENCE('#{table_name}', 'id') AS name"
|
46
|
+
sequence_name = @postgresql_adapter.execute(get_sequence_name_sql).first['name']
|
47
|
+
if sequence_name.present?
|
48
|
+
sql = "SELECT setval('#{sequence_name}', coalesce((SELECT MAX(id) FROM #{table_name}),1))"
|
49
|
+
@postgresql_adapter.execute(sql)
|
50
|
+
end
|
51
|
+
Dry::Monads::Success(true)
|
52
|
+
rescue ActiveRecord::StatementInvalid # means sequence or column does not exist
|
47
53
|
Dry::Monads::Success(true)
|
48
54
|
end
|
49
55
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sample_data_dump_postgres_data_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bellroy Dev Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|