I hope this fixes #666. I do not have PostgreSQL to test. Please test and reopen if this does not work

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@748 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lrbalt 2008-03-18 20:22:24 +00:00
parent 93bbce7636
commit 2a6ed8f002

View file

@ -1,7 +1,7 @@
class ProjectsContextsRemoveNotNullFromPosition < ActiveRecord::Migration
def self.up
change_column :projects, :position, :integer, {:null => true, :default => false}
change_column :contexts, :position, :integer, {:null => true, :default => false}
change_column :projects, :position, :integer, {:null => true, :default => nil}
change_column :contexts, :position, :integer, {:null => true, :default => nil}
end
def self.down
@ -10,13 +10,13 @@ class ProjectsContextsRemoveNotNullFromPosition < ActiveRecord::Migration
project.position = 0 if !project.position?
project.save
end
change_column :projects, :position, :integer, {:null => false, :default => false}
change_column :projects, :position, :integer, {:null => false, :default => nil}
@contexts = Context.find(:all)
@contexts.each do |context|
context.position = 0 if !context.position?
context.save
end
change_column :contexts, :position, :integer, {:null => false, :default => false}
change_column :contexts, :position, :integer, {:null => false, :default => nil}
end
end