2020-08-07 01:14:14 +02:00
|
|
|
class AddRequiredUserForTask < ActiveRecord::Migration[4.2]
|
2009-01-06 11:49:19 +01:00
|
|
|
def self.up
|
|
|
|
add_column :tasks, :required_users, :integer, :default => 1
|
|
|
|
add_column :groups, :task_required_users, :integer, :default => 1
|
|
|
|
# add default values to every task and group
|
|
|
|
Task.find(:all).each { |task| task.update_attribute :required_users, 1 }
|
|
|
|
Group.workgroups.each { |group| group.update_attribute :task_required_users, 1 }
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
remove_column :tasks, :required_users
|
|
|
|
remove_column :groups, :tasks_required_users
|
|
|
|
end
|
|
|
|
end
|