summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-03-14 17:25:11 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-03-14 17:25:11 +0100
commit4aa3ce75342f26be3c87ac8c84f24658b9ef22a4 (patch)
tree4b4f528d723bbd3cd6368aba5ae0be38874f7b32
parent17a9ecf8cf6724613b38c08040bdb786ffe30718 (diff)
downloadgitlab-ce-4aa3ce75342f26be3c87ac8c84f24658b9ef22a4.tar.gz
Add check for orphaned UsersGroups
-rw-r--r--lib/tasks/gitlab/check.rake10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake
index 2b158fe14ee..467a91fbe86 100644
--- a/lib/tasks/gitlab/check.rake
+++ b/lib/tasks/gitlab/check.rake
@@ -17,6 +17,7 @@ namespace :gitlab do
check_database_config_exists
check_database_is_not_sqlite
check_migrations_are_up
+ check_orphaned_users_groups
check_gitlab_config_exists
check_gitlab_config_not_outdated
check_log_writable
@@ -181,6 +182,15 @@ namespace :gitlab do
end
end
+ def check_orphaned_users_groups
+ print "Database contains orphaned UsersGroups? ... "
+ if UsersGroup.where("user_id not in (select id from users)").count > 0
+ puts "yes".red
+ else
+ puts "no".green
+ end
+ end
+
def check_satellites_exist
print "Projects have satellites? ... "