fx-sequence 0.1.1 → 0.1.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/fx/sequence/adapters/postgres/sequences.rb +20 -4
- data/lib/fx/sequence/command_recorder.rb +4 -0
- data/lib/fx/sequence/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d73385a8621ac337e099f90e7efb1764454f341b123feb1f06890869caeb5072
|
4
|
+
data.tar.gz: 2ff5c8fc13c5d292d59045afc7c3efbba8502667134cc52c91e51e11c8eebdd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b4dcace4770cf2fcc7c6313da8e4368a867f61b0ea884d9b0b0540359e872a8098eb846448fdc4af8de33531fa8c4c3a3467c1e96f859d318eee8d4f10b3cf5
|
7
|
+
data.tar.gz: b15a6e8b586296fab214a742b18b9ab6e49181140f9797bc3a2c573c8c0595eba16e0491a0c54bd65c8e95c1a08a39378299ee1f9dfeec1d1376f2a43637d14f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.1.2]
|
4
|
+
|
5
|
+
[0.1.2]: https://github.com/aevula/fx-sequence/compare/v0.1.1...v0.1.2
|
6
|
+
|
7
|
+
- Rewrote SQL-query to ignore auto-generated sequences for tables primary keys
|
8
|
+
|
3
9
|
## [0.1.1]
|
4
10
|
|
5
11
|
[0.1.1]: https://github.com/aevula/fx-sequence/compare/v0.1.0...v0.1.1
|
@@ -9,11 +9,27 @@ module Fx
|
|
9
9
|
class Sequences
|
10
10
|
SEQUENCES_WITH_DEFINITIONS_QUERY = <<~SQL
|
11
11
|
SELECT ps.relname AS name,
|
12
|
-
|
12
|
+
'CREATE SEQUENCE IF NOT EXISTS ' || ps.relname AS definition
|
13
13
|
FROM pg_class ps
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
JOIN pg_namespace pn ON
|
15
|
+
ps.relnamespace = pn.oid
|
16
|
+
LEFT JOIN pg_depend pd ON
|
17
|
+
pd.objid = ps.oid AND
|
18
|
+
pd.classid = 'pg_class'::regclass AND
|
19
|
+
pd.deptype = 'a'
|
20
|
+
LEFT JOIN pg_class pt ON
|
21
|
+
pd.refobjid = pt.oid
|
22
|
+
LEFT JOIN pg_attribute pa ON
|
23
|
+
pa.attrelid = pt.oid AND
|
24
|
+
pa.attnum = pd.refobjsubid
|
25
|
+
LEFT JOIN pg_constraint pc ON
|
26
|
+
pc.conrelid = pt.oid AND
|
27
|
+
pa.attnum = ANY(pc.conkey) AND
|
28
|
+
pc.contype = 'p'
|
29
|
+
WHERE
|
30
|
+
pn.nspname = 'public' AND
|
31
|
+
ps.relkind = 'S' AND
|
32
|
+
pc.oid IS NULL;
|
17
33
|
SQL
|
18
34
|
private_constant :SEQUENCES_WITH_DEFINITIONS_QUERY
|
19
35
|
|
data/lib/fx/sequence/version.rb
CHANGED