convergence 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +1 -1
- data/lib/convergence/diff.rb +8 -2
- data/lib/convergence/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdf6c82541efe1895f0e5346134025b161376199
|
4
|
+
data.tar.gz: cb67cd83c49cb3ece78f0b639c9cde1882f7b59e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d8799c6997f90911cb6e2197f7b091442a93b0015b3baf1420ce355b6541f6a87fd109e75ece21bd153cc1e8770b32398c6ad85b34f4c7c1bad17031daf8b3b
|
7
|
+
data.tar.gz: 2a730487ee76fda3a585c6e62224afbd192c9b86d4942ee56cb21b2cae834aed90fc74b5b47b221104c6a71cdc31231b0ac27c5fccf4274e0b1e1484546a9ef3
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
convergence (0.1.
|
4
|
+
convergence (0.1.7)
|
5
5
|
diff-lcs
|
6
6
|
diffy
|
7
7
|
mysql2
|
@@ -36,7 +36,7 @@ GEM
|
|
36
36
|
rb-inotify (>= 0.9)
|
37
37
|
lumberjack (1.0.9)
|
38
38
|
method_source (0.8.2)
|
39
|
-
mysql2 (0.4.
|
39
|
+
mysql2 (0.4.4)
|
40
40
|
parser (2.2.0.pre.5)
|
41
41
|
ast (>= 1.1, < 3.0)
|
42
42
|
slop (~> 3.4, >= 3.4.5)
|
@@ -88,4 +88,4 @@ DEPENDENCIES
|
|
88
88
|
rubocop
|
89
89
|
|
90
90
|
BUNDLED WITH
|
91
|
-
1.
|
91
|
+
1.12.5
|
data/README.md
CHANGED
data/lib/convergence/diff.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'diff/lcs'
|
2
2
|
|
3
3
|
class Convergence::Diff
|
4
|
+
CASE_SENSITIVE_COLUMNS = %i(default comment)
|
5
|
+
|
4
6
|
def diff(from_database, to_database)
|
5
7
|
delta = {}
|
6
8
|
from_database = {} if from_database.nil?
|
@@ -76,12 +78,12 @@ class Convergence::Diff
|
|
76
78
|
to_column_option_with_type = (from_column.options.map { |k, _v| { k => nil } }.reduce { |a, e| a.merge(e) } || {})
|
77
79
|
.merge(to_column.options)
|
78
80
|
.merge(type: to_column.type)
|
79
|
-
.map { |k, v| [k, v.to_s.downcase] }
|
81
|
+
.map { |k, v| [k, case_sensitive_column?(k) ? v.to_s : v.to_s.downcase] }
|
80
82
|
.to_a
|
81
83
|
from_column_option_with_type = from_column
|
82
84
|
.options
|
83
85
|
.merge(type: from_column.type)
|
84
|
-
.map { |k, v| [k, v.to_s.downcase] }
|
86
|
+
.map { |k, v| [k, case_sensitive_column?(k) ? v.to_s : v.to_s.downcase] }
|
85
87
|
.to_a
|
86
88
|
{ column_name => Hash[(to_column_option_with_type - from_column_option_with_type)] }
|
87
89
|
end
|
@@ -158,4 +160,8 @@ class Convergence::Diff
|
|
158
160
|
def removed_all_columns?(from_table, diff)
|
159
161
|
from_table.columns.each_key.all? { |name| diff[:remove_column].each_key.include?(name) }
|
160
162
|
end
|
163
|
+
|
164
|
+
def case_sensitive_column?(column)
|
165
|
+
CASE_SENSITIVE_COLUMNS.include?(column)
|
166
|
+
end
|
161
167
|
end
|
data/lib/convergence/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: convergence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shinsuke Nishio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
version: '0'
|
249
249
|
requirements: []
|
250
250
|
rubyforge_project:
|
251
|
-
rubygems_version: 2.
|
251
|
+
rubygems_version: 2.5.1
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: DB Schema management tool
|