| ... | @@ -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,19 @@ namespace :gitlab do |
... | @@ -181,6 +182,19 @@ 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
|
|
|
|
try_fixing_it(
|
|
|
|
"You can delete the orphaned records using something along the lines of:",
|
|
|
|
sudo_gitlab("bundle exec rails runner -e production 'UsersGroup.where(\"user_id NOT IN (SELECT id FROM users)\").delete_all'")
|
|
|
|
)
|
|
|
|
else
|
|
|
|
puts "no".green
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
def check_satellites_exist
|
|
def check_satellites_exist
|
|
|
print "Projects have satellites? ... "
|
|
print "Projects have satellites? ... "
|
|
|
|
|
|
| ... | |
... | |
| ... | | ... | |