Permalink
Browse files

Add enabled column to notifiers table

  • Loading branch information...
1 parent 143b75b commit 40165ec11b5c747e75056260c79d018527040cf9 @sr sr committed Mar 29, 2009
Showing with 13 additions and 2 deletions.
  1. +10 −0 lib/integrity/migrations.rb
  2. +1 −0 lib/integrity/notifier.rb
  3. +2 −2 test/unit/migrations_test.rb
@@ -136,5 +136,15 @@ class ::Integrity::Build
end
end
end
+
+ migration 3, :add_enabled_column do
+ up do
+ modify_table(:integrity_notifiers) { add_column :enabled, Boolean }
+ end
+
+ down do
+ modify_table(:integrity_notifiers) { remove_column :enabled }
+ end
+ end
end
end
@@ -6,6 +6,7 @@ class Notifier
property :id, Integer, :serial => true
property :name, String, :nullable => false
+ property :enabled, Boolean, :nullable => false, :default => false
property :config, Yaml, :nullable => false, :lazy => false
belongs_to :project, :class_name => "Integrity::Project"
@@ -30,7 +30,7 @@ def load_initial_migration_fixture
test "upgrading a pre migration database" do
capture_stdout { Integrity.migrate_db }
- current_migrations.should == ["initial", "add_commits"]
+ current_migrations.should == ["initial", "add_commits", "add_enabled_column"]
assert table_exists?("integrity_projects")
assert table_exists?("integrity_builds")
assert table_exists?("integrity_notifiers")
@@ -41,7 +41,7 @@ def load_initial_migration_fixture
load_initial_migration_fixture
capture_stdout { Integrity.migrate_db }
- current_migrations.should == ["initial", "add_commits"]
+ current_migrations.should == ["initial", "add_commits", "add_enabled_column"]
sinatra = Project.first(:name => "Sinatra")
sinatra.should have(1).commits

0 comments on commit 40165ec

Please sign in to comment.