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
|
2023-05-12 13:01:12 +02:00
|
|
|
add_column :tasks, :required_users, :integer, default: 1
|
|
|
|
add_column :groups, :task_required_users, :integer, default: 1
|
2009-01-06 11:49:19 +01:00
|
|
|
# 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
|