summaryrefslogtreecommitdiffstats
path: root/db/migrate/068_create_enabled_modules.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-14 11:34:08 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-14 11:34:08 +0000
commit21c97c6a1376a38a3951c57069317c17c81029f8 (patch)
tree8d38f129585767d4c1eb2c78d0b9b978aff14d70 /db/migrate/068_create_enabled_modules.rb
parent29348fafb7ca43cb00ef80f29e61167647df0cd8 (diff)
downloadredmine-21c97c6a1376a38a3951c57069317c17c81029f8.tar.gz
redmine-21c97c6a1376a38a3951c57069317c17c81029f8.zip
Added project module concept.
A project module (eg. issue tracking, news, wiki,...) is a set of permissions that can enabled/disabled at project level. For each project, modules can be enabled on the project settings view ('Modules' tab). This requires a specific permission: 'Select project modules' (if this permission is turned off, only Redmine administrators can choose which modules a project uses). When applying this migration, all modules are enabled for all existing projects. git-svn-id: http://redmine.rubyforge.org/svn/trunk@725 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate/068_create_enabled_modules.rb')
-rw-r--r--db/migrate/068_create_enabled_modules.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/068_create_enabled_modules.rb b/db/migrate/068_create_enabled_modules.rb
new file mode 100644
index 000000000..fd848ef96
--- /dev/null
+++ b/db/migrate/068_create_enabled_modules.rb
@@ -0,0 +1,18 @@
+class CreateEnabledModules < ActiveRecord::Migration
+ def self.up
+ create_table :enabled_modules do |t|
+ t.column :project_id, :integer
+ t.column :name, :string, :null => false
+ end
+ add_index :enabled_modules, [:project_id], :name => :enabled_modules_project_id
+
+ # Enable all modules for existing projects
+ Project.find(:all).each do |project|
+ project.enabled_module_names = Redmine::AccessControl.available_project_modules
+ end
+ end
+
+ def self.down
+ drop_table :enabled_modules
+ end
+end