tapsoob 0.4.18 → 0.4.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tapsoob/operation.rb +2 -2
- data/lib/tapsoob/utils.rb +3 -2
- data/lib/tapsoob/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: 3ae0fadaae87496510d5ba645478eab092666a51db14e0225dd666cf33b3b2da
|
4
|
+
data.tar.gz: 900c0a0aa8711bffba6a7e2c404f8f18ca737df178b3e136d512b0a76433d015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70355d42c987f1b739764cc1e318d0ae98aa62fa016187012d2d5716f5b33516e0646196157d7ad5fbd1ab58d8e597c5de8a3a2e096b468131060f3919630731
|
7
|
+
data.tar.gz: fd2dd601102884014c0e41fd613f03881a2bc117abdc672309afcb7b5a396c7740d349489c84646b859da2917eb4646cc7632a2364f7182cd34635f193e8b183
|
data/lib/tapsoob/operation.rb
CHANGED
@@ -393,7 +393,7 @@ module Tapsoob
|
|
393
393
|
log.info "#{tables.size} tables, #{format_number(record_count)} records"
|
394
394
|
|
395
395
|
tables.each do |table_name, count|
|
396
|
-
next unless File.exists?(File.join(dump_path, "data", "#{table_name}.json"))
|
396
|
+
next unless File.exists?(File.join(dump_path, "data", "#{table_name}.json")) || JSON.parse(File.read(File.join(dump_path, "data", "#{table_name}.json")))["data"].size == 0
|
397
397
|
db[table_name.to_sym].truncate if @opts[:purge]
|
398
398
|
stream = Tapsoob::DataStream.factory(db, {
|
399
399
|
:table_name => table_name,
|
@@ -485,7 +485,7 @@ module Tapsoob
|
|
485
485
|
|
486
486
|
def fetch_local_tables_info
|
487
487
|
tables_with_counts = {}
|
488
|
-
tbls = Dir.glob(File.join(dump_path, "
|
488
|
+
tbls = Dir.glob(File.join(dump_path, "schemas", "*")).map { |path| File.basename(path, ".rb") }
|
489
489
|
tbls.each do |table|
|
490
490
|
if File.exists?(File.join(dump_path, "data", "#{table}.json"))
|
491
491
|
data = JSON.parse(File.read(File.join(dump_path, "data", "#{table}.json")))
|
data/lib/tapsoob/utils.rb
CHANGED
@@ -75,8 +75,9 @@ Data : #{data}
|
|
75
75
|
res = { table_name: table, header: header, data: only_data }
|
76
76
|
|
77
77
|
# Add types if schema isn't empty
|
78
|
+
db.extension :schema_dumper # Add schema dumper extension in case it hasn't been added until now
|
78
79
|
res[:types] = schema.map do |c|
|
79
|
-
case db.column_schema_to_ruby_type(c.last
|
80
|
+
case db.column_schema_to_ruby_type(c.last)[:type]
|
80
81
|
when BigDecimal
|
81
82
|
"float"
|
82
83
|
when :Bignum
|
@@ -86,7 +87,7 @@ Data : #{data}
|
|
86
87
|
when TrueClass
|
87
88
|
"boolean"
|
88
89
|
else
|
89
|
-
db.column_schema_to_ruby_type(c.last
|
90
|
+
db.column_schema_to_ruby_type(c.last)[:type].to_s.downcase
|
90
91
|
end
|
91
92
|
end unless schema.empty?
|
92
93
|
|
data/lib/tapsoob/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tapsoob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Félix Bellanger
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-10-
|
12
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ripl
|