You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

068_create_enabled_modules.rb 529B

123456789101112131415161718
  1. class CreateEnabledModules < ActiveRecord::Migration[4.2]
  2. def self.up
  3. create_table :enabled_modules do |t|
  4. t.column :project_id, :integer
  5. t.column :name, :string, :null => false
  6. end
  7. add_index :enabled_modules, [:project_id], :name => :enabled_modules_project_id
  8. # Enable all modules for existing projects
  9. Project.all.each do |project|
  10. project.enabled_module_names = Redmine::AccessControl.available_project_modules
  11. end
  12. end
  13. def self.down
  14. drop_table :enabled_modules
  15. end
  16. end