From 2a6ed8f00243f15416e4607c2d0b83ccbd668567 Mon Sep 17 00:00:00 2001 From: lrbalt Date: Tue, 18 Mar 2008 20:22:24 +0000 Subject: [PATCH] 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 --- ...038_projects_contexts_remove_not_null_from_position.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tracks/db/migrate/038_projects_contexts_remove_not_null_from_position.rb b/tracks/db/migrate/038_projects_contexts_remove_not_null_from_position.rb index 2e2e5acc..12e1b745 100644 --- a/tracks/db/migrate/038_projects_contexts_remove_not_null_from_position.rb +++ b/tracks/db/migrate/038_projects_contexts_remove_not_null_from_position.rb @@ -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