summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 21:09:23 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 21:09:23 +0000
commit32fd4cd5e2134511936899d6bcc4aaf18b9be6fd (patch)
tree10378ceffed52dd0e160a0d9bcf3c5ab72c18958 /db
parent951616a26a61e880860ad862c1d45a8e3762b4bc (diff)
downloadgitlab-ce-32fd4cd5e2134511936899d6bcc4aaf18b9be6fd.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200221023320_add_index_on_pages_domain_on_domain_lowercase.rb19
-rw-r--r--db/migrate/20200221074028_add_mr_metrics_first_approved_at.rb13
-rw-r--r--db/post_migrate/20200221142216_remove_repository_storage_from_snippets.rb28
-rw-r--r--db/schema.rb3
4 files changed, 62 insertions, 1 deletions
diff --git a/db/migrate/20200221023320_add_index_on_pages_domain_on_domain_lowercase.rb b/db/migrate/20200221023320_add_index_on_pages_domain_on_domain_lowercase.rb
new file mode 100644
index 00000000000..53f8f5e7f81
--- /dev/null
+++ b/db/migrate/20200221023320_add_index_on_pages_domain_on_domain_lowercase.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddIndexOnPagesDomainOnDomainLowercase < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ INDEX_NAME = 'index_pages_domains_on_domain_lowercase'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :pages_domains, 'LOWER(domain)', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :pages_domains, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20200221074028_add_mr_metrics_first_approved_at.rb b/db/migrate/20200221074028_add_mr_metrics_first_approved_at.rb
new file mode 100644
index 00000000000..993905f66ce
--- /dev/null
+++ b/db/migrate/20200221074028_add_mr_metrics_first_approved_at.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddMrMetricsFirstApprovedAt < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def up
+ add_column :merge_request_metrics, :first_approved_at, :datetime_with_timezone
+ end
+
+ def down
+ remove_column :merge_request_metrics, :first_approved_at
+ end
+end
diff --git a/db/post_migrate/20200221142216_remove_repository_storage_from_snippets.rb b/db/post_migrate/20200221142216_remove_repository_storage_from_snippets.rb
new file mode 100644
index 00000000000..f9ef985218b
--- /dev/null
+++ b/db/post_migrate/20200221142216_remove_repository_storage_from_snippets.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class RemoveRepositoryStorageFromSnippets < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ return unless column_exists?(:snippets, :repository_storage)
+
+ remove_column :snippets, :repository_storage
+ end
+
+ def down
+ return if column_exists?(:snippets, :repository_storage)
+
+ add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault
+ :snippets,
+ :repository_storage,
+ :string,
+ default: 'default',
+ limit: 255,
+ allow_null: false
+ )
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 8052a93e841..36bf8ad5e01 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -2537,6 +2537,7 @@ ActiveRecord::Schema.define(version: 2020_02_24_163804) do
t.integer "diff_size"
t.integer "modified_paths_size"
t.integer "commits_count"
+ t.datetime_with_timezone "first_approved_at"
t.index ["first_deployed_to_production_at"], name: "index_merge_request_metrics_on_first_deployed_to_production_at"
t.index ["latest_closed_at"], name: "index_merge_request_metrics_on_latest_closed_at", where: "(latest_closed_at IS NOT NULL)"
t.index ["latest_closed_by_id"], name: "index_merge_request_metrics_on_latest_closed_by_id"
@@ -3062,6 +3063,7 @@ ActiveRecord::Schema.define(version: 2020_02_24_163804) do
t.boolean "wildcard", default: false, null: false
t.integer "usage", limit: 2, default: 0, null: false
t.integer "scope", limit: 2, default: 2, null: false
+ t.index "lower((domain)::text)", name: "index_pages_domains_on_domain_lowercase"
t.index ["certificate_source", "certificate_valid_not_after"], name: "index_pages_domains_need_auto_ssl_renewal", where: "(auto_ssl_enabled = true)"
t.index ["domain", "wildcard"], name: "index_pages_domains_on_domain_and_wildcard", unique: true
t.index ["project_id", "enabled_until"], name: "index_pages_domains_on_project_id_and_enabled_until"
@@ -3938,7 +3940,6 @@ ActiveRecord::Schema.define(version: 2020_02_24_163804) do
t.string "encrypted_secret_token", limit: 255
t.string "encrypted_secret_token_iv", limit: 255
t.boolean "secret", default: false, null: false
- t.string "repository_storage", limit: 255, default: "default", null: false
t.index ["author_id"], name: "index_snippets_on_author_id"
t.index ["content"], name: "index_snippets_on_content_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["created_at"], name: "index_snippets_on_created_at"