Empact-trackless_triggers 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  = CHANGELOG
2
2
 
3
+ == 0.1.1
4
+
5
+ * Add support for DROP TRIGGER IF EXISTS to update_trigger and drop_trigger
6
+
3
7
  == 0.1.0
4
8
 
5
9
  * Add update_trigger
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{Empact-trackless_triggers}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aaron Patterson", "Christian Eager"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -40,7 +40,7 @@ module ActiveRecord
40
40
 
41
41
  module SchemaStatements
42
42
  def update_trigger(name, opts = {})
43
- drop_trigger(name)
43
+ drop_trigger(name, opts)
44
44
  add_trigger(name, opts)
45
45
  end
46
46
 
@@ -48,8 +48,8 @@ module ActiveRecord
48
48
  execute "CREATE TRIGGER #{name} #{opts[:timing]} #{opts[:event]} ON #{opts[:on]} FOR EACH ROW #{opts[:statement]}"
49
49
  end
50
50
 
51
- def drop_trigger(name)
52
- execute("DROP TRIGGER #{name}")
51
+ def drop_trigger(name, opts = {})
52
+ execute("DROP TRIGGER #{"IF EXISTS" if opts[:if_exists]} #{name}")
53
53
  end
54
54
  end
55
55
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Empact-trackless_triggers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aaron Patterson