redmine_dmsf/db/migrate/20150120152101_notifications_nullable.rb
William Schey ed91504785 Notifications Always On (#262)
Commit: 68dd2e4c831b192cebed155877e6100e2691ec6b
defaulted DMSF to always send notifications. This changes the default notification to use the Global notification setting in the DMSF settings as per issue #262.
2015-01-20 16:04:31 +10:00

32 lines
1.5 KiB
Ruby

# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2014 Karel Pičman <karel.picman@lbcfree.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class NotificationsNullable < ActiveRecord::Migration
def up
# Switch on the default notifications for new projects and folders
change_column :projects, :dmsf_notification, :boolean, :default => false, :null => true
change_column :dmsf_folders, :notification, :boolean, :default => false, :null => true
change_column :dmsf_files, :notification, :boolean, :default => false, :null => true
end
def down
change_column :projects, :dmsf_notification, :boolean, :default => true, :null => false
change_column :dmsf_folders, :notification, :boolean, :default => true, :null => false
change_column :dmsf_files, :notification, :boolean, :default => true, :null => false
end
end