summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-17 10:14:58 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-17 10:14:58 +0000
commitb4013dc9f2c028637d6311df9a9db0302350f848 (patch)
tree00afb6601e22b5fd618c719dd4efbc3d1afe58b4 /db
parentc0a57964433e4045d3c6b1a15b7db007c40cbb37 (diff)
downloadredmine-b4013dc9f2c028637d6311df9a9db0302350f848.tar.gz
redmine-b4013dc9f2c028637d6311df9a9db0302350f848.zip
Removed the default 0 value for issues foreign keys.
It prevents useless "... where id=0" queries and ensures that *_id attributes default to nil. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11417 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20130217094251_remove_issues_default_fk_values.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20130217094251_remove_issues_default_fk_values.rb b/db/migrate/20130217094251_remove_issues_default_fk_values.rb
new file mode 100644
index 000000000..9345cf0b8
--- /dev/null
+++ b/db/migrate/20130217094251_remove_issues_default_fk_values.rb
@@ -0,0 +1,19 @@
+class RemoveIssuesDefaultFkValues < ActiveRecord::Migration
+ def up
+ change_column_default :issues, :tracker_id, nil
+ change_column_default :issues, :project_id, nil
+ change_column_default :issues, :status_id, nil
+ change_column_default :issues, :assigned_to_id, nil
+ change_column_default :issues, :priority_id, nil
+ change_column_default :issues, :author_id, nil
+ end
+
+ def down
+ change_column_default :issues, :tracker_id, 0
+ change_column_default :issues, :project_id, 0
+ change_column_default :issues, :status_id, 0
+ change_column_default :issues, :assigned_to_id, 0
+ change_column_default :issues, :priority_id, 0
+ change_column_default :issues, :author_id, 0
+ end
+end