summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-06-28 08:48:54 +0000
committerDouwe Maan <douwe@gitlab.com>2018-06-28 08:48:54 +0000
commit687278a6dd4296ecdd61028d4ad7ea3d2b2b7df3 (patch)
tree4062c1c7630d9061ebcf29b0fbfc4272df2aaada /lib
parente38db19659857f949eca4c844cfc1af1c69d8fab (diff)
parent2efe4a13b6be650258ade395438600c64820cb19 (diff)
downloadgitlab-ce-687278a6dd4296ecdd61028d4ad7ea3d2b2b7df3.tar.gz
Merge branch 'db-configure-after-drop-tables' into 'master'
Fixes an issue where migrations instead of schema loading were run Closes #48564 See merge request gitlab-org/gitlab-ce!20227
Diffstat (limited to 'lib')
-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