зеркало из
https://github.com/redmine/redmine.git
synced 2024-08-27 05:58:46 +02:00
![Jean-Philippe Lang](/assets/img/avatar_default.png)
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
20 строки
715 B
Ruby
20 строки
715 B
Ruby
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
|