summaryrefslogtreecommitdiff
path: root/db/post_migrate/20220620132300_update_last_run_date_for_iterations_cadences.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 15:40:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 15:40:28 +0000
commitb595cb0c1dec83de5bdee18284abe86614bed33b (patch)
tree8c3d4540f193c5ff98019352f554e921b3a41a72 /db/post_migrate/20220620132300_update_last_run_date_for_iterations_cadences.rb
parent2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff)
downloadgitlab-ce-b595cb0c1dec83de5bdee18284abe86614bed33b.tar.gz
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'db/post_migrate/20220620132300_update_last_run_date_for_iterations_cadences.rb')
-rw-r--r--db/post_migrate/20220620132300_update_last_run_date_for_iterations_cadences.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/post_migrate/20220620132300_update_last_run_date_for_iterations_cadences.rb b/db/post_migrate/20220620132300_update_last_run_date_for_iterations_cadences.rb
new file mode 100644
index 00000000000..50b0b25d469
--- /dev/null
+++ b/db/post_migrate/20220620132300_update_last_run_date_for_iterations_cadences.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class UpdateLastRunDateForIterationsCadences < Gitlab::Database::Migration[2.0]
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ execute <<~SQL
+ UPDATE iterations_cadences SET last_run_date=CURRENT_DATE WHERE automatic=true;
+ SQL
+ end
+
+ def down
+ # no op
+ # 'last_run_date' stores the date on which the cadence record should be
+ # updated using `CreateIterationsInAdvance` service that is idempotent
+ # and the column is only useful for optimizing when to run the service
+ # ('last_run_date' is also a misnomer as it can be better-named 'next_run_date'.)
+ end
+end