tapsoob 0.5.15 → 0.5.17

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: f66f2cafc229eb8bf6aaf9a158f985bee6b58d90849ee060fab94eed2dbcf75c
4
- data.tar.gz: 109661e0446de0bf871add2556fa8bf58400e51c89cf49a9643099ea6b1070d9
3
+ metadata.gz: 64db655c8de67d74305a3e0e431e37d5aab6ef0ce5a150006cdb6bdda510a3fe
4
+ data.tar.gz: 8671b1c25a65b2e4a0a3427f28da8f2e891889e8e541568cd230c0444fc4f8d2
5
5
  SHA512:
6
- metadata.gz: 6907567fef3c04f633a433f09916c1b28b6bfed5754433a3d7d6071441daa3ccc2f90ab3b6f92bd65076d4e37f1f06254f40b1dedff2678f4ac283f35137c26b
7
- data.tar.gz: 646c94325dfe49711a642ad85c96da8b06613ab44ff017f77491b7436e54fdd9d77ef30de8d9b32f5e5e11cc4be47956f4213d703476f6df4c4f6398f3216f8c
6
+ metadata.gz: cbe57ce8e55a46b51f41e846db28f49f5f413604d8f81c0e78b5c823113ea289f5f94a4f4225a5f4d0fad896674bb1ad32164626aaabfeeef0289bdd55b4d120
7
+ data.tar.gz: c620a69b6731d7634b928f78f90f7dd0ab83401a149337b17f0b2c87107f0b4727ecbd3b6da818bf846befb40d71ae7de196db9ecd2147c1ed51b553907dbaf6
@@ -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: ruby
6
6
  authors:
7
7
  - Félix Bellanger