forklift_etl 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +8 -8
- data/lib/forklift/transports/mysql.rb +3 -2
- data/lib/forklift/version.rb +1 -1
- data/spec/integration/mysql_spec.rb +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWJmZWViNzNiMTljYzRmMDJjZmUyNDhlYWJhODU5ZTM5MmFkNmMwYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDU1OTJlN2Q2MWU4ZDEyYTJhNzRiYWI0YmIzZjA5NzQ1NjVhODVmMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWRiM2QzNzVkYjE2OGM1Y2VmMmQxNWQyZGEyYmMyM2Q1YmUyYTI3NmZkZjI1
|
10
|
+
MzExMzA4M2EwY2IwMWIyNTI1NzI0YTMzZDU4MjE4ZWEwYzY2Y2U4YzgwYmEz
|
11
|
+
NjM3MDI3YjVjMjE2OWI0ZmQwY2FmMzI2NjQzZTBmYmNkZjFmNzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODJlMGI3ODUwZWQ2M2VmYzljODMyNmQzZThjZjUzMDY2NWVhZDcxNGQwYWIy
|
14
|
+
MDFkNDZiMjg2MmRiNTIyOThkNDQxYWM4MjNjOGEyZDVjODA4N2YxMDA5NGY2
|
15
|
+
ZmYzZmU4YzljYjA5YjJkYWUxNDcwMGM0NDIyNjA3MDVlZWFkYjE=
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
forklift_etl (1.1.
|
4
|
+
forklift_etl (1.1.5)
|
5
5
|
activesupport (~> 4.0, >= 4.0.0)
|
6
6
|
elasticsearch (~> 1.0, >= 1.0.0)
|
7
7
|
lumberjack (~> 1.0, >= 1.0.0)
|
@@ -11,7 +11,7 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activesupport (4.1.
|
14
|
+
activesupport (4.1.2)
|
15
15
|
i18n (~> 0.6, >= 0.6.9)
|
16
16
|
json (~> 1.7, >= 1.7.7)
|
17
17
|
minitest (~> 5.1)
|
@@ -20,12 +20,12 @@ GEM
|
|
20
20
|
addressable (2.3.6)
|
21
21
|
awesome_print (1.2.0)
|
22
22
|
diff-lcs (1.2.5)
|
23
|
-
elasticsearch (1.0.
|
24
|
-
elasticsearch-api (= 1.0.
|
25
|
-
elasticsearch-transport (= 1.0.
|
26
|
-
elasticsearch-api (1.0.
|
23
|
+
elasticsearch (1.0.4)
|
24
|
+
elasticsearch-api (= 1.0.4)
|
25
|
+
elasticsearch-transport (= 1.0.4)
|
26
|
+
elasticsearch-api (1.0.4)
|
27
27
|
multi_json
|
28
|
-
elasticsearch-transport (1.0.
|
28
|
+
elasticsearch-transport (1.0.4)
|
29
29
|
faraday
|
30
30
|
multi_json
|
31
31
|
email_spec (1.5.0)
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
json (1.8.1)
|
38
38
|
launchy (2.4.2)
|
39
39
|
addressable (~> 2.3)
|
40
|
-
lumberjack (1.0.
|
40
|
+
lumberjack (1.0.9)
|
41
41
|
mail (2.5.4)
|
42
42
|
mime-types (~> 1.16)
|
43
43
|
treetop (~> 1.4.8)
|
@@ -107,6 +107,7 @@ module Forklift
|
|
107
107
|
def sql_type(v)
|
108
108
|
return "bigint(20)" if v.class == Fixnum
|
109
109
|
return "float" if v.class == Float
|
110
|
+
return "float" if v.class == BigDecimal
|
110
111
|
return "date" if v.class == Date
|
111
112
|
return "datetime" if v.class == Time
|
112
113
|
return "datetime" if v.class == DateTime
|
@@ -230,7 +231,7 @@ module Forklift
|
|
230
231
|
if !value.nil?
|
231
232
|
sql_type = sql_type(value)
|
232
233
|
alter_sql = "ALTER TABLE `#{database}`.`#{table}` CHANGE `#{row[:Field]}` `#{row[:Field]}` #{sql_type};"
|
233
|
-
|
234
|
+
forklift.logger.log alter_sql
|
234
235
|
q(alter_sql)
|
235
236
|
end
|
236
237
|
|
@@ -269,7 +270,7 @@ module Forklift
|
|
269
270
|
part = "\"#{s}\""
|
270
271
|
elsif( [::Fixnum].include?(v.class) )
|
271
272
|
part = v
|
272
|
-
elsif( [::Float].include?(v.class) )
|
273
|
+
elsif( [::Float, ::BigDecimal].include?(v.class) )
|
273
274
|
part = v.to_f
|
274
275
|
end
|
275
276
|
a << part
|
data/lib/forklift/version.rb
CHANGED
@@ -106,9 +106,9 @@ describe 'mysql' do
|
|
106
106
|
|
107
107
|
it "can lazy-create a table without primary keys provided" do
|
108
108
|
data = [
|
109
|
-
{thing: 'stuff a', updated_at: Time.new},
|
110
|
-
{thing: 'stuff b', updated_at: Time.new},
|
111
|
-
{thing: 'stuff c', updated_at: Time.new},
|
109
|
+
{thing: 'stuff a', number: 1.123, updated_at: Time.new},
|
110
|
+
{thing: 'stuff b', number: 1.123, updated_at: Time.new},
|
111
|
+
{thing: 'stuff c', number: 1.123, updated_at: Time.new},
|
112
112
|
]
|
113
113
|
table = "new_table"
|
114
114
|
plan = SpecPlan.new
|
@@ -126,11 +126,13 @@ describe 'mysql' do
|
|
126
126
|
expect(row["Type"]).to eql "bigint(20)"
|
127
127
|
when "thing"
|
128
128
|
expect(row["Type"]).to eql "text"
|
129
|
+
when "number"
|
130
|
+
expect(row["Type"]).to eql "float"
|
129
131
|
when "updated_at"
|
130
132
|
expect(row["Type"]).to eql "datetime"
|
131
133
|
end
|
132
134
|
end
|
133
|
-
expect(cols).to eql ['id', 'thing', 'updated_at']
|
135
|
+
expect(cols).to eql ['id', 'thing', 'number', 'updated_at']
|
134
136
|
end
|
135
137
|
|
136
138
|
it "can will seek further for null-ish values" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forklift_etl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Tahler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|