Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-02 06:09:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-02 06:09:51 +0300
commitd786065288786404ab802b15eadf3aa87183c2ff (patch)
tree09cc1d15c5b2190eed61b005761f202058a508c1 /db
parent926711e4546e0cf845c6cbe5773076f2195357f0 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb27
-rw-r--r--db/schema_migrations/202106010734001
2 files changed, 28 insertions, 0 deletions
diff --git a/db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb b/db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb
new file mode 100644
index 00000000000..85302ee1d20
--- /dev/null
+++ b/db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+class FixTotalStageInVsa < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ disable_ddl_transaction!
+
+ TOTAL_STAGE = 'Total'
+
+ class GroupStage < ActiveRecord::Base
+ include EachBatch
+
+ self.table_name = 'analytics_cycle_analytics_group_stages'
+ end
+
+ def up
+ GroupStage.reset_column_information
+
+ GroupStage.each_batch(of: 100) do |relation|
+ relation.where(name: TOTAL_STAGE, custom: false).update_all(custom: true)
+ end
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/schema_migrations/20210601073400 b/db/schema_migrations/20210601073400
new file mode 100644
index 00000000000..eb4eed721fe
--- /dev/null
+++ b/db/schema_migrations/20210601073400
@@ -0,0 +1 @@
+668f65ea77042e5b8054681e76f583a6061aca921b685f90d155fc4121e7ff78 \ No newline at end of file