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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f87bd795a89acabf42bd2ff9cc75dd2035d024cc877d8cf47f45cf8cc96b3029
4
- data.tar.gz: dce4ea88bed8c8cf92e68020f528721dbe43eebcfa9adb92f3e0669a90cba6f3
3
+ metadata.gz: 50acf974664b7ae8917c8fc20aded1f23d2fcf8125534b4c8b498a08da7cb63b
4
+ data.tar.gz: bbe5f9639f59cdef8b60054528786b83e88e81aa4d10a142032fb8d3342a968e
5
5
  SHA512:
6
- metadata.gz: c9f263214ec9a1d04f7e1c795c7d91b8a476cd9776ce67d16e4bec86a1db93684c9183090ff7cf7926bf29fe13260abafb24f56c71c59d5500e991983f24db61
7
- data.tar.gz: 2274e86e0cdc654b5635400910c532957db83dc7f7de14f3ee497f8e7fecf31fd7d6dea1c9ec12a9fc2eeb8794bf6e816de9499f37ae1acb4af95e38c4c91443
6
+ metadata.gz: 55665d3b16286ac9c726d39f2008e5f075e3e5a64d85a351cb1bf33a61fccb649895d83719889fe3fb0fce2ae9f624cfb84cf5920814edb6691e4db2d5b12183
7
+ data.tar.gz: 13510d5e13ee27ca84b99e7c82bfc2709a21460d652eeb153458dcfe4157fa8ee4c285f1165244c21f807567686ec42b7a44b7edace6eb011f6e034872fa0ea7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- table_saw (2.0.0)
4
+ table_saw (2.1.0)
5
5
  pg
6
6
  thor
7
7
 
@@ -13,7 +13,7 @@ module TableSaw
13
13
  def call
14
14
  File.delete(file) if File.exist?(file)
15
15
 
16
- alter_constraints_to_deferrable
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 alter_constraints_to_deferrable
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: DEFERRABLE
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} DEFERRABLE;"
78
+ write_to_file "ALTER TABLE #{name} ALTER CONSTRAINT #{constraint_name} #{keyword};"
77
79
  end
78
80
  end
79
81
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TableSaw
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
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.0.0
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-28 00:00:00.000000000 Z
11
+ date: 2019-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg