taps 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/taps/schema.rb +7 -1
  3. metadata +3 -3
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :build:
3
3
  :minor: 3
4
- :patch: 2
4
+ :patch: 3
5
5
  :major: 0
@@ -20,6 +20,10 @@ Class.new(Sequel::Migration) do
20
20
  def up
21
21
  #{db.dump_table_schema(table, :indexes => false)}
22
22
  end
23
+
24
+ def down
25
+ drop_table(\"#{table}\") if @db.table_exists?(\"#{table}\")
26
+ end
23
27
  end
24
28
  END_MIG
25
29
  end
@@ -55,7 +59,9 @@ END_MIG
55
59
 
56
60
  def load(database_url, schema)
57
61
  Sequel.connect(database_url) do |db|
58
- eval(schema).apply(db, :up)
62
+ klass = eval(schema)
63
+ klass.apply(db, :down)
64
+ klass.apply(db, :up)
59
65
  end
60
66
  end
61
67
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 2
9
- version: 0.3.2
8
+ - 3
9
+ version: 0.3.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ricardo Chimal, Jr.
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-16 00:00:00 -07:00
17
+ date: 2010-04-22 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency