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>2020-01-28 00:08:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-28 00:08:47 +0300
commite4ea43b2b85ad5f3115f00220601eb719705139a (patch)
tree1888a43f802e45ebb8dfed59595a790807777c6f /db
parent390582e118752426acf5cb25ec99103d312d891c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20200122144759_drop_kibana_column.rb9
-rw-r--r--db/post_migrate/20200127090233_remove_invalid_issue_tracker_data.rb24
-rw-r--r--db/schema.rb3
3 files changed, 34 insertions, 2 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
diff --git a/db/schema.rb b/db/schema.rb
index 8f8a44f1519..e4ec6e55fa6 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_24_053531) do
+ActiveRecord::Schema.define(version: 2020_01_27_090233) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@@ -1150,7 +1150,6 @@ ActiveRecord::Schema.define(version: 2020_01_24_053531) do
t.bigint "cluster_id", null: false
t.integer "status", null: false
t.string "version", limit: 255, null: false
- t.string "kibana_hostname", limit: 255
t.text "status_reason"
t.index ["cluster_id"], name: "index_clusters_applications_elastic_stacks_on_cluster_id", unique: true
end