Skip to content

Commit 028ee9a

Browse files
committed
Fix migration/undo migration issues associated with changesets.notified_cia
1 parent d729a6c commit 028ee9a

2 files changed

+3
-3
lines changed

Diff for: db/migrate/2011072600000_extend_changesets_notified_cia.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ def self.up
44
end
55

66
def self.down
7-
remove_column :changesets, :notified_cia
7+
# Deal with fact that one of next migrations doesn't restore :notified_cia
8+
remove_column(:changesets, :notified_cia) rescue nil
89
end
910
end

Diff for: db/migrate/2011081700000_move_notified_cia_to_git_cia_notifications.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ def self.up
88
t.column :scmid, :string
99
end
1010

11-
1211
# Speed up searches
1312
add_index(:git_cia_notifications, :scmid)
1413
# Make sure uniqueness of the two columns, :scmid, :repository_id
@@ -17,7 +16,7 @@ def self.up
1716
Project.find(:all).each {|project|
1817
if project.repository.is_a?(Repository::Git)
1918
project.repository.changesets.each { |changeset|
20-
if not changeset.notified_cia.nil? and changeset.notified_cia == 1
19+
if changeset.respond_to?(:notified_cia) and changeset.notified_cia == 1
2120
#project.repository.set_notified(changeset)
2221
project.repository.cia_notifications.push GitCiaNotification.new(:scmid => changeset.scmid)
2322
#cia_notification = GitCiaNotification.new

0 commit comments

Comments
 (0)