bigquery_migration 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/CHANGELOG.md +10 -0
- data/lib/bigquery_migration/bigquery_wrapper.rb +6 -3
- data/lib/bigquery_migration/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c113ced051e1bf7c9b8a78123b56e06cb750251f
|
4
|
+
data.tar.gz: 3d9f5f9c8ea1af31753b7ea92eb77a8a8a612ef5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d98d9fac6a2466fba7bddadf38fedccf11829782c549bf7b2ac3709bf7836fc42725cdd385e34c3cf56da262501d35315f4cd516a826309ff5b2b2236a47ca65
|
7
|
+
data.tar.gz: a9e14ad54d9144d6414af8d0c09922821905dbde2738dfec1eb5fd17a9c67a403b970e4ca8b46b193cd9aea9be3650ff8082cefb4a9d9ef417dec87fe69db7d9
|
data/CHANGELOG.md
CHANGED
@@ -202,6 +202,7 @@ class BigqueryMigration
|
|
202
202
|
def insert_table(dataset: nil, table: nil, columns: )
|
203
203
|
dataset ||= self.dataset
|
204
204
|
table ||= self.table
|
205
|
+
raise Error, "columns is empty" if columns.empty?
|
205
206
|
schema = Schema.new(columns)
|
206
207
|
|
207
208
|
begin
|
@@ -655,12 +656,14 @@ class BigqueryMigration
|
|
655
656
|
end
|
656
657
|
Schema.validate_columns!(columns)
|
657
658
|
|
658
|
-
before_columns = existing_columns
|
659
|
-
|
660
659
|
result = {}
|
661
|
-
|
660
|
+
begin
|
661
|
+
get_table
|
662
|
+
rescue NotFoundError
|
663
|
+
before_columns = []
|
662
664
|
result = create_table(table: table, columns: columns)
|
663
665
|
else
|
666
|
+
before_columns = existing_columns
|
664
667
|
add_columns = Schema.diff_columns(before_columns, columns)
|
665
668
|
drop_columns = Schema.diff_columns(columns, before_columns)
|
666
669
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bigquery_migration
|
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
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-api-client
|