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)
This commit is contained in:
parent
5c13af58b8
commit
a9fcf96856
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Fixes an issue where migrations instead of schema loading were run
|
||||
merge_request: 20227
|
||||
author:
|
||||
type: changed
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue