diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-11 17:45:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-11 17:45:10 +0000 |
commit | 888c3581eb0fbfc5ede87a24f7f03bfa4f7d810b (patch) | |
tree | 17bb48e3b640635b2fa62b85e2b10ccaf5b4f65c /db/migrate/20130710182539_add_queries_visibility.rb | |
parent | 4545b906b4c58e2bd1d201fd18a49249aa571dfc (diff) | |
download | redmine-888c3581eb0fbfc5ede87a24f7f03bfa4f7d810b.tar.gz redmine-888c3581eb0fbfc5ede87a24f7f03bfa4f7d810b.zip |
Role based custom queries (#1019).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11994 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate/20130710182539_add_queries_visibility.rb')
-rw-r--r-- | db/migrate/20130710182539_add_queries_visibility.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20130710182539_add_queries_visibility.rb b/db/migrate/20130710182539_add_queries_visibility.rb new file mode 100644 index 000000000..d6cd1a7b3 --- /dev/null +++ b/db/migrate/20130710182539_add_queries_visibility.rb @@ -0,0 +1,13 @@ +class AddQueriesVisibility < ActiveRecord::Migration + def up + add_column :queries, :visibility, :integer, :default => 0 + Query.where(:is_public => true).update_all(:visibility => 2) + remove_column :queries, :is_public + end + + def down + add_column :queries, :is_public, :boolean, :default => true, :null => false + Query.where('visibility <> ?', 2).update_all(:is_public => false) + remove_column :queries, :visibility + end +end |