summaryrefslogtreecommitdiff
path: root/db/migrate/20131112220935_add_visibility_level_to_projects.rb
diff options
context:
space:
mode:
authorJason Hollingsworth <jhworth.developer@gmail.com>2013-11-06 09:13:21 -0600
committerJason Hollingsworth <jhworth.developer@gmail.com>2013-11-26 22:22:07 -0600
commitd9bb4230cc3aa161876df821c34d8e9c53d2e7a6 (patch)
treed9923bbf4ebe3f6cf96f71cdcfe4c07cc94b6752 /db/migrate/20131112220935_add_visibility_level_to_projects.rb
parent51b5509bacdfba1d3ca84a4b56c6bd21942f1d2e (diff)
downloadgitlab-ce-d9bb4230cc3aa161876df821c34d8e9c53d2e7a6.tar.gz
Adding authenticated public mode (internal).
Added visibility_level icons to project view (rather than just text). Added public projects to search results. Added ability to restrict visibility levels standard users can set.
Diffstat (limited to 'db/migrate/20131112220935_add_visibility_level_to_projects.rb')
-rw-r--r--db/migrate/20131112220935_add_visibility_level_to_projects.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20131112220935_add_visibility_level_to_projects.rb b/db/migrate/20131112220935_add_visibility_level_to_projects.rb
new file mode 100644
index 00000000000..cf1e9f912a0
--- /dev/null
+++ b/db/migrate/20131112220935_add_visibility_level_to_projects.rb
@@ -0,0 +1,13 @@
+class AddVisibilityLevelToProjects < ActiveRecord::Migration
+ def self.up
+ add_column :projects, :visibility_level, :integer, :default => 0, :null => false
+ Project.where(public: true).update_all(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
+ remove_column :projects, :public
+ end
+
+ def self.down
+ add_column :projects, :public, :boolean, :default => false, :null => false
+ Project.where(visibility_level: Gitlab::VisibilityLevel::PUBLIC).update_all(public: true)
+ remove_column :projects, :visibility_level
+ end
+end