diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-22 21:07:13 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-22 21:07:13 +0000 |
commit | 8f7f305f7cf89c6086411ad846223bd2583f8369 (patch) | |
tree | 23b408368058d62c9669932ea6b5e689979894e1 | |
parent | 33003e5b2d881a30df7dc37a0c2a7b07b2a67ebe (diff) | |
download | redmine-8f7f305f7cf89c6086411ad846223bd2583f8369.tar.gz redmine-8f7f305f7cf89c6086411ad846223bd2583f8369.zip |
Removed 'not null' constraint on position fields.
Previous migrations updated for new sqlite databases.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@864 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | db/migrate/019_add_issue_status_position.rb | 2 | ||||
-rw-r--r-- | db/migrate/020_add_role_position.rb | 2 | ||||
-rw-r--r-- | db/migrate/021_add_tracker_position.rb | 2 | ||||
-rw-r--r-- | db/migrate/045_create_boards.rb | 2 | ||||
-rw-r--r-- | db/migrate/072_add_enumerations_position.rb | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/db/migrate/019_add_issue_status_position.rb b/db/migrate/019_add_issue_status_position.rb index 1c65e52e3..ed24d27c1 100644 --- a/db/migrate/019_add_issue_status_position.rb +++ b/db/migrate/019_add_issue_status_position.rb @@ -1,6 +1,6 @@ class AddIssueStatusPosition < ActiveRecord::Migration def self.up - add_column :issue_statuses, :position, :integer, :default => 1, :null => false + add_column :issue_statuses, :position, :integer, :default => 1 IssueStatus.find(:all).each_with_index {|status, i| status.update_attribute(:position, i+1)} end diff --git a/db/migrate/020_add_role_position.rb b/db/migrate/020_add_role_position.rb index 3afa88193..e220bd9fd 100644 --- a/db/migrate/020_add_role_position.rb +++ b/db/migrate/020_add_role_position.rb @@ -1,6 +1,6 @@ class AddRolePosition < ActiveRecord::Migration def self.up - add_column :roles, :position, :integer, :default => 1, :null => false + add_column :roles, :position, :integer, :default => 1 Role.find(:all).each_with_index {|role, i| role.update_attribute(:position, i+1)} end diff --git a/db/migrate/021_add_tracker_position.rb b/db/migrate/021_add_tracker_position.rb index 30a5d771c..ef9775620 100644 --- a/db/migrate/021_add_tracker_position.rb +++ b/db/migrate/021_add_tracker_position.rb @@ -1,6 +1,6 @@ class AddTrackerPosition < ActiveRecord::Migration def self.up - add_column :trackers, :position, :integer, :default => 1, :null => false + add_column :trackers, :position, :integer, :default => 1 Tracker.find(:all).each_with_index {|tracker, i| tracker.update_attribute(:position, i+1)} end diff --git a/db/migrate/045_create_boards.rb b/db/migrate/045_create_boards.rb index b8647c812..17f2bbbe2 100644 --- a/db/migrate/045_create_boards.rb +++ b/db/migrate/045_create_boards.rb @@ -4,7 +4,7 @@ class CreateBoards < ActiveRecord::Migration t.column :project_id, :integer, :null => false t.column :name, :string, :default => "", :null => false t.column :description, :string - t.column :position, :integer, :default => 1, :null => false + t.column :position, :integer, :default => 1 t.column :topics_count, :integer, :default => 0, :null => false t.column :messages_count, :integer, :default => 0, :null => false t.column :last_message_id, :integer diff --git a/db/migrate/072_add_enumerations_position.rb b/db/migrate/072_add_enumerations_position.rb index 6f2a93219..e0beaf395 100644 --- a/db/migrate/072_add_enumerations_position.rb +++ b/db/migrate/072_add_enumerations_position.rb @@ -1,6 +1,6 @@ class AddEnumerationsPosition < ActiveRecord::Migration def self.up - add_column(:enumerations, :position, :integer, :default => 1, :null => false) unless Enumeration.column_names.include?('position') + add_column(:enumerations, :position, :integer, :default => 1) unless Enumeration.column_names.include?('position') Enumeration.find(:all).group_by(&:opt).each_value do |enums| enums.each_with_index do |enum, i| # do not call model callbacks |