foodsoft/db/migrate/022_add_required_user_for_task.rb
Philipp Rothmann fb2b4d8a8a chore: rubocop
chore: fix api test conventions

chore: rubocop -A spec/

chore: more rubocop -A

fix failing test

rubocop fixes

removes helper methods that are in my opinion dead code

more rubocop fixes

rubocop -a --auto-gen-config
2023-06-09 17:35:05 +02:00

14 lines
537 B
Ruby

class AddRequiredUserForTask < ActiveRecord::Migration[4.2]
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