Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4aa3ce75
Commit
4aa3ce75
authored
Mar 14, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add check for orphaned UsersGroups
parent
17a9ecf8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+10
-0
No files found.
lib/tasks/gitlab/check.rake
View file @
4aa3ce75
...
@@ -17,6 +17,7 @@ namespace :gitlab do
...
@@ -17,6 +17,7 @@ namespace :gitlab do
check_database_config_exists
check_database_config_exists
check_database_is_not_sqlite
check_database_is_not_sqlite
check_migrations_are_up
check_migrations_are_up
check_orphaned_users_groups
check_gitlab_config_exists
check_gitlab_config_exists
check_gitlab_config_not_outdated
check_gitlab_config_not_outdated
check_log_writable
check_log_writable
...
@@ -181,6 +182,15 @@ namespace :gitlab do
...
@@ -181,6 +182,15 @@ namespace :gitlab do
end
end
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
def
check_satellites_exist
print
"Projects have satellites? ... "
print
"Projects have satellites? ... "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment