diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-09 15:09:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-09 15:09:24 +0300 |
commit | a9ced7da447785c57477b3d8dbccc73a78cface1 (patch) | |
tree | 5179d27ab9d801748ee4ed1c64c985974e799812 /lib/tasks | |
parent | ad0265eead72a624ce7a020847db4f0f0c877e57 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/db.rake | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index 69d542a4f02..506027aa866 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -80,16 +80,19 @@ namespace :gitlab do end desc 'This adjusts and cleans db/structure.sql - it runs after db:structure:dump' - task :clean_structure_sql do + task :clean_structure_sql do |task_name| structure_file = 'db/structure.sql' schema = File.read(structure_file) File.open(structure_file, 'wb+') do |io| Gitlab::Database::SchemaCleaner.new(schema).clean(io) end + + # Allow this task to be called multiple times, as happens when running db:migrate:redo + Rake::Task[task_name].reenable end - # Inform Rake that gitlab:schema:fix_structure_sql should be run every time rake db:structure:dump is run + # Inform Rake that gitlab:schema:clean_structure_sql should be run every time rake db:structure:dump is run Rake::Task['db:structure:dump'].enhance do Rake::Task['gitlab:db:clean_structure_sql'].invoke end |