diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-15 03:06:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-15 03:06:05 +0300 |
commit | 386e5740f68fc7f49bc7692a28e927d6ea5ab056 (patch) | |
tree | 36c74aefd8101dbf439e11ba9bf1c0cf45f0ff16 /db | |
parent | b1ffdbb7f92407ceef575e557af07a3e3d067edf (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20191112232338_ensure_no_empty_milestone_titles.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/db/migrate/20191112232338_ensure_no_empty_milestone_titles.rb b/db/migrate/20191112232338_ensure_no_empty_milestone_titles.rb new file mode 100644 index 00000000000..76cb511424e --- /dev/null +++ b/db/migrate/20191112232338_ensure_no_empty_milestone_titles.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class EnsureNoEmptyMilestoneTitles < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + loop do + rows_updated = exec_update <<~SQL + UPDATE milestones SET title = '%BLANK' WHERE id IN (SELECT id FROM milestones WHERE title = '' LIMIT 500) + SQL + break if rows_updated < 500 + end + end + + def down; end +end diff --git a/db/schema.rb b/db/schema.rb index 36883130b78..72d1d957d6b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_11_12_221821) do +ActiveRecord::Schema.define(version: 2019_11_12_232338) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" |