diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-27 21:08:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-27 21:08:47 +0000 |
commit | e4ea43b2b85ad5f3115f00220601eb719705139a (patch) | |
tree | 1888a43f802e45ebb8dfed59595a790807777c6f /db/post_migrate | |
parent | 390582e118752426acf5cb25ec99103d312d891c (diff) | |
download | gitlab-ce-e4ea43b2b85ad5f3115f00220601eb719705139a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate')
-rw-r--r-- | db/post_migrate/20200122144759_drop_kibana_column.rb | 9 | ||||
-rw-r--r-- | db/post_migrate/20200127090233_remove_invalid_issue_tracker_data.rb | 24 |
2 files changed, 33 insertions, 0 deletions
diff --git a/db/post_migrate/20200122144759_drop_kibana_column.rb b/db/post_migrate/20200122144759_drop_kibana_column.rb new file mode 100644 index 00000000000..ce94ca2dc27 --- /dev/null +++ b/db/post_migrate/20200122144759_drop_kibana_column.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class DropKibanaColumn < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + remove_column :clusters_applications_elastic_stacks, :kibana_hostname, :string, limit: 255 + end +end diff --git a/db/post_migrate/20200127090233_remove_invalid_issue_tracker_data.rb b/db/post_migrate/20200127090233_remove_invalid_issue_tracker_data.rb new file mode 100644 index 00000000000..6d64dd3d0d1 --- /dev/null +++ b/db/post_migrate/20200127090233_remove_invalid_issue_tracker_data.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RemoveInvalidIssueTrackerData < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + sql = "DELETE FROM issue_tracker_data WHERE \ + (length(encrypted_issues_url) > 0 AND encrypted_issues_url_iv IS NULL) \ + OR (length(encrypted_new_issue_url) > 0 AND encrypted_new_issue_url_iv IS NULL) \ + OR (length(encrypted_project_url) > 0 AND encrypted_project_url_iv IS NULL)" + + execute(sql) + end + + def down + # We need to figure out why migrating data to issue_tracker_data table + # failed and then can recreate the data + end +end |