summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-23 21:08:35 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-23 21:08:35 +0000
commit24256212ea84e6fb6509f6fb317a2d2bac3d0d06 (patch)
treee4300d70d8e724179d9de657a68d88462aaaf04a /db
parentd933bc5a8738d24898c5a82cc72ee9bd050425e6 (diff)
downloadgitlab-ce-24256212ea84e6fb6509f6fb317a2d2bac3d0d06.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20200123155929_remove_invalid_jira_data.rb25
-rw-r--r--db/schema.rb2
2 files changed, 26 insertions, 1 deletions
diff --git a/db/post_migrate/20200123155929_remove_invalid_jira_data.rb b/db/post_migrate/20200123155929_remove_invalid_jira_data.rb
new file mode 100644
index 00000000000..7ddac15c3fb
--- /dev/null
+++ b/db/post_migrate/20200123155929_remove_invalid_jira_data.rb
@@ -0,0 +1,25 @@
+# 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 RemoveInvalidJiraData < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ sql = "DELETE FROM jira_tracker_data WHERE \
+ (length(encrypted_api_url) > 0 AND encrypted_api_url_iv IS NULL) \
+ OR (length(encrypted_url) > 0 AND encrypted_url_iv IS NULL) \
+ OR (length(encrypted_username) > 0 AND encrypted_username_iv IS NULL) \
+ OR (length(encrypted_password) > 0 AND encrypted_password_iv IS NULL)"
+
+ execute(sql)
+ end
+
+ def down
+ # We need to figure out why migrating data to jira_tracker_data table
+ # failed and then can recreate the data
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index f6b44f9de00..8ad4e080fe7 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: 2020_01_21_132641) do
+ActiveRecord::Schema.define(version: 2020_01_23_155929) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"