diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-22 00:10:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-22 00:10:56 +0300 |
commit | 8e056c9ef3f085a8b04749375821fdd20e8e9c05 (patch) | |
tree | 1f93d4f724030d00c0e8c46defaa6b669e7eb4bd | |
parent | f26782b146ed115c8e36f8d6fc4c173020ab30b6 (diff) |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | lib/tasks/gitlab/db.rake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index bbfdf598e42..399405953a7 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -129,16 +129,31 @@ namespace :gitlab do end # Inform Rake that custom tasks should be run every time rake db:structure:dump is run + # + # Rails 6.1 deprecates db:structure:dump in favor of db:schema:dump Rake::Task['db:structure:dump'].enhance do Rake::Task['gitlab:db:clean_structure_sql'].invoke Rake::Task['gitlab:db:dump_custom_structure'].invoke end + # Inform Rake that custom tasks should be run every time rake db:schema:dump is run + Rake::Task['db:schema:dump'].enhance do + Rake::Task['gitlab:db:clean_structure_sql'].invoke + Rake::Task['gitlab:db:dump_custom_structure'].invoke + end + # Inform Rake that custom tasks should be run every time rake db:structure:load is run + # + # Rails 6.1 deprecates db:structure:load in favor of db:schema:load Rake::Task['db:structure:load'].enhance do Rake::Task['gitlab:db:load_custom_structure'].invoke end + # Inform Rake that custom tasks should be run every time rake db:schema:load is run + Rake::Task['db:schema:load'].enhance do + Rake::Task['gitlab:db:load_custom_structure'].invoke + end + desc 'Create missing dynamic database partitions' task :create_dynamic_partitions do Gitlab::Database::Partitioning::PartitionCreator.new.create_partitions @@ -159,10 +174,16 @@ namespace :gitlab do # # Other than that it's helpful to create partitions early when bootstrapping # a new installation. + # + # Rails 6.1 deprecates db:structure:load in favor of db:schema:load Rake::Task['db:structure:load'].enhance do Rake::Task['gitlab:db:create_dynamic_partitions'].invoke end + Rake::Task['db:schema:load'].enhance do + Rake::Task['gitlab:db:create_dynamic_partitions'].invoke + end + # During testing, db:test:load restores the database schema from scratch # which does not include dynamic partitions. We cannot rely on application # initializers here as the application can continue to run while |