summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorDJ Mountney <david@twkie.net>2018-06-27 13:34:45 -0700
committerDJ Mountney <david@twkie.net>2018-06-27 13:39:55 -0700
commita9fcf968566a63cc5af70789e9b7e558c68585c2 (patch)
treeca87168ede32752dd4888a547f42e72130f67583 /lib/tasks
parent5c13af58b89c6b6721ba018e519738b291f7f72b (diff)
downloadgitlab-ce-a9fcf968566a63cc5af70789e9b7e558c68585c2.tar.gz
Fixes an issue where migrations instead of schema loading were run
If you called rake gitlab:db:drop_tables before running gitlab-ctl reconfigure (or rake gitlab:db:configure)
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/db.rake4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake
index 139ab70e125..69166851816 100644
--- a/lib/tasks/gitlab/db.rake
+++ b/lib/tasks/gitlab/db.rake
@@ -46,7 +46,9 @@ namespace :gitlab do
desc 'Configures the database by running migrate, or by loading the schema and seeding if needed'
task configure: :environment do
- if ActiveRecord::Base.connection.tables.any?
+ # Check if we have existing db tables
+ # The schema_migrations table will still exist if drop_tables was called
+ if ActiveRecord::Base.connection.tables.count > 1
Rake::Task['db:migrate'].invoke
else
Rake::Task['db:schema:load'].invoke