table_saw 2.0.0 → 2.1.0
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/Gemfile.lock +1 -1
- data/lib/table_saw/create_dump_file.rb +6 -4
- data/lib/table_saw/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 50acf974664b7ae8917c8fc20aded1f23d2fcf8125534b4c8b498a08da7cb63b
|
|
4
|
+
data.tar.gz: bbe5f9639f59cdef8b60054528786b83e88e81aa4d10a142032fb8d3342a968e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55665d3b16286ac9c726d39f2008e5f075e3e5a64d85a351cb1bf33a61fccb649895d83719889fe3fb0fce2ae9f624cfb84cf5920814edb6691e4db2d5b12183
|
|
7
|
+
data.tar.gz: 13510d5e13ee27ca84b99e7c82bfc2709a21460d652eeb153458dcfe4157fa8ee4c285f1165244c21f807567686ec42b7a44b7edace6eb011f6e034872fa0ea7
|
data/Gemfile.lock
CHANGED
|
@@ -13,7 +13,7 @@ module TableSaw
|
|
|
13
13
|
def call
|
|
14
14
|
File.delete(file) if File.exist?(file)
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
alter_constraints_deferrability
|
|
17
17
|
|
|
18
18
|
write_to_file <<~SQL
|
|
19
19
|
BEGIN;
|
|
@@ -58,22 +58,24 @@ module TableSaw
|
|
|
58
58
|
restart_sequences
|
|
59
59
|
|
|
60
60
|
write_to_file 'COMMIT;'
|
|
61
|
+
|
|
62
|
+
alter_constraints_deferrability keyword: 'NOT DEFERRABLE'
|
|
61
63
|
end
|
|
62
64
|
# rubocop:enable Metrics/MethodLength,Metrics/AbcSize
|
|
63
65
|
|
|
64
66
|
private
|
|
65
67
|
|
|
66
|
-
def
|
|
68
|
+
def alter_constraints_deferrability(keyword: 'DEFERRABLE')
|
|
67
69
|
records.each_key do |name|
|
|
68
70
|
write_to_file <<~COMMENT
|
|
69
71
|
--
|
|
70
|
-
-- Alter Constraints for Name: #{name}; Type:
|
|
72
|
+
-- Alter Constraints for Name: #{name}; Type: #{keyword}
|
|
71
73
|
--
|
|
72
74
|
|
|
73
75
|
COMMENT
|
|
74
76
|
|
|
75
77
|
TableSaw.information_schema.constraint_names[name].each do |constraint_name|
|
|
76
|
-
write_to_file "ALTER TABLE #{name} ALTER CONSTRAINT #{constraint_name}
|
|
78
|
+
write_to_file "ALTER TABLE #{name} ALTER CONSTRAINT #{constraint_name} #{keyword};"
|
|
77
79
|
end
|
|
78
80
|
end
|
|
79
81
|
end
|
data/lib/table_saw/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: table_saw
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hamed Asghari
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-12-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pg
|