tapsoob 0.3.8-java → 0.3.13-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: 2d3ab72e8b99be12c81678c0576411c9ecacdab0b1f40432710afad1de2eee38
4
- data.tar.gz: 0d4f7624488356b7823b8f135a4e39627251e63497f208de6bd8848e367e3f40
3
+ metadata.gz: cb8a00a3e0e55eebdd6fe0fadd07b36f728f6e7339484ca1dafe33672e08d72a
4
+ data.tar.gz: 61e763aae7ca21507d9558f652f1ed600dcce77bf53b1b72ceff81990b9b2d85
5
5
  SHA512:
6
- metadata.gz: b48f391f4a0ab695ebc73b0a76385b03580cbdf99888be4201b8375b31728f6e91af610e865ffd32c80e4a3ebb447d0a01d700136b391571859246936d87ee0a
7
- data.tar.gz: 70b5a111087345c59f6c8b9c49f40913a4c07ad70b3647c1f875e3f671b19aa3e76f2c027531284827930969a3855919ea876a588e27440183974b7bf5676ab5
6
+ metadata.gz: 8fa22198dfbfbcfb103e7f217a83f6bb7160280d38ecca7fb595573563ac2ebc243a39fa63cd97d67422e08d38cb602b84544db74d6817e415e185e980fad3a5
7
+ data.tar.gz: 60c9d09e6218b649793a79b38ef521938dade0c4dc072864cd0fc37bbc9aeb46a9d9f6631cf98f2f8e9b7ccf2c7f53b6aed7b4cb6549cd7f20bff33047e7001c
@@ -2,6 +2,7 @@
2
2
  require 'sequel'
3
3
  require 'sequel/extensions/schema_dumper'
4
4
  require 'sequel/extensions/migration'
5
+ require 'erb'
5
6
  require 'json'
6
7
 
7
8
  module Tapsoob
@@ -11,7 +12,23 @@ module Tapsoob
11
12
  def dump(database_url)
12
13
  db = Sequel.connect(database_url)
13
14
  db.extension :schema_dumper
14
- db.dump_schema_migration(:indexes => false)
15
+ template = ERB.new <<-END_MIG
16
+ Class.new(Sequel::Migration) do
17
+ def up
18
+ <% db.tables.each do |table| %>
19
+ <%= db.dump_table_schema(table, indexes: false) %>
20
+ <% end %>
21
+ end
22
+
23
+ def down
24
+ <% db.tables.each do |table| %>
25
+ drop_table("<%= table %>", if_exists: true)
26
+ <% end %>
27
+ end
28
+ end
29
+ END_MIG
30
+
31
+ template.result(binding)
15
32
  end
16
33
 
17
34
  def dump_table(database_url, table)
@@ -21,7 +38,7 @@ module Tapsoob
21
38
  <<END_MIG
22
39
  Class.new(Sequel::Migration) do
23
40
  def up
24
- #{db.dump_table_schema(table, :indexes => false)}
41
+ #{db.dump_table_schema(table, indexes: false)}
25
42
  end
26
43
 
27
44
  def down
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Tapsoob
3
- VERSION = "0.3.8".freeze
3
+ VERSION = "0.3.13".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.3.8
4
+ version: 0.3.13
5
5
  platform: java
6
6
  authors:
7
7
  - Félix Bellanger