tapsoob 0.5.15-java → 0.5.17-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b51adf658b9af21c0386a4533839158a6fd3a3f6c57b5a15da11aef8b6850580
4
- data.tar.gz: ae2e9dfde6726aa931aebd9f83cd009c649a52aaca0bfc99acd29a6d2c3fa29b
3
+ metadata.gz: e08807035ac52e24f58ed1fd41f5a8307daf0c884457d965e27eece63431ee31
4
+ data.tar.gz: 42ee008367b72f9b463be276f338ee8c937493b05338c98ad73bc4c20c231ad0
5
5
  SHA512:
6
- metadata.gz: c2bd2278deb8deffaeef61bd8cac6be7262c6e41c30cd6ecbd31e5a2062ca946e4a49285a11aa4ec9ef9b2c523976c99602337896ffa2b0935226dfea0349067
7
- data.tar.gz: 8f5752e79519d5db1bafd0c3df5e128bb6daed0f77083cd47da18317cf60ae6771de903298678100a48516aa9a987986f576eecdf5632b6d0f0bf810ad464dc9
6
+ metadata.gz: 0a4194f65d920ed2dd56bdea6419d1be02f77a25fc4a31aa927a03d2e1e7630be3b0afad8e7f0f6ba248865a20be6e61cb8e65bec5abf1fa81e90d2385d895d4
7
+ data.tar.gz: 9a46d9763354e97c9ac039fa55df53e4519980e079590557ad6da8edc558b6990c4946704ead192d0305996b5d797ec970b1ebd6045b07efb58099dc2cf25e20
@@ -18,6 +18,8 @@ module Tapsoob
18
18
  option :"disable-compression", desc: "Disable Compression", default: false, type: :boolean, aliases: "-g"
19
19
  option :tables, desc: "Shortcut to filter on a list of tables", type: :array, aliases: "-t"
20
20
  option :"exclude-tables", desc: "Shortcut to exclude a list of tables", type: :array, aliases: "-e"
21
+ option :"indexes", type: :boolean, default: false
22
+ option :"same-db", type: :boolean, default: false
21
23
  option :progress, desc: "Show progress", default: true, type: :boolean
22
24
  option :debug, desc: "Enable debug messages", default: false, type: :boolean
23
25
  def pull(dump_path, database_url)
@@ -40,7 +42,6 @@ module Tapsoob
40
42
  option :tables, desc: "Shortcut to filter on a list of tables", type: :array, aliases: "-t"
41
43
  option :"exclude-tables", desc: "Shortcut to exclude a list of tables", type: :array, aliases: "-e"
42
44
  option :purge, desc: "Purge data in tables prior to performing the import", default: false, type: :boolean, aliases: "-p"
43
- option :"same-db", type: :boolean, default: false
44
45
  option :"skip-duplicates", desc: "Remove duplicates when loading data", default: false, type: :boolean
45
46
  option :"discard-identity", desc: "Remove identity when pushing data (may result in creating duplicates)", default: false, type: :boolean
46
47
  option :progress, desc: "Show progress", default: true, type: :boolean
@@ -80,6 +81,7 @@ module Tapsoob
80
81
  }
81
82
 
82
83
  # Pull only options
84
+ opts[:indexes] = options[:"indexes"] if options.key?(:"indexes")
83
85
  opts[:same_db] = options[:"same-db"] if options.key?(:"same-db")
84
86
 
85
87
  # Push only options
@@ -183,7 +183,7 @@ module Tapsoob
183
183
 
184
184
  progress = ProgressBar.new('Schema', tables.size)
185
185
  tables.each do |table_name, count|
186
- schema_data = Tapsoob::Schema.dump_table(database_url, table_name)
186
+ schema_data = Tapsoob::Schema.dump_table(database_url, table_name, @opts.slice(:indexes, :same_db))
187
187
  log.debug "Table: #{table_name}\n#{schema_data}\n"
188
188
  output = Tapsoob::Utils.export_schema(dump_path, table_name, schema_data)
189
189
  puts output if dump_path.nil? && output
@@ -31,14 +31,14 @@ END_MIG
31
31
  template.result(binding)
32
32
  end
33
33
 
34
- def dump_table(database_url, table)
34
+ def dump_table(database_url, table, options)
35
35
  table = table.to_sym
36
36
  Sequel.connect(database_url) do |db|
37
37
  db.extension :schema_dumper
38
38
  <<END_MIG
39
39
  Class.new(Sequel::Migration) do
40
40
  def up
41
- #{db.dump_table_schema(table, indexes: false)}
41
+ #{db.dump_table_schema(table, options)}
42
42
  end
43
43
 
44
44
  def down
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Tapsoob
3
- VERSION = "0.5.15".freeze
3
+ VERSION = "0.5.17".freeze
4
4
  end
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.5.15
4
+ version: 0.5.17
5
5
  platform: java
6
6
  authors:
7
7
  - Félix Bellanger