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-07 18:07:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-07 18:07:34 +0300
commitb4028d450087e97f26d4baa23e08396bcbabe3e0 (patch)
treef84a5cbb29e43bab0ba58db1bc5619112c8c482e /db
parent05f1d5d9813332bdd456cb358517e56168a24224 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20191218124915_add_repository_storage_to_snippets.rb24
-rw-r--r--db/migrate/20191218125015_add_storage_version_to_snippets.rb23
-rw-r--r--db/post_migrate/20200106071113_update_fingerprint_sha256_within_keys.rb22
-rw-r--r--db/schema.rb4
4 files changed, 72 insertions, 1 deletions
diff --git a/db/migrate/20191218124915_add_repository_storage_to_snippets.rb b/db/migrate/20191218124915_add_repository_storage_to_snippets.rb
new file mode 100644
index 00000000000..df9a9d2ff43
--- /dev/null
+++ b/db/migrate/20191218124915_add_repository_storage_to_snippets.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class AddRepositoryStorageToSnippets < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault
+ :snippets,
+ :repository_storage,
+ :string,
+ default: 'default',
+ limit: 255,
+ allow_null: false
+ )
+ end
+
+ def down
+ remove_column(:snippets, :repository_storage)
+ end
+end
diff --git a/db/migrate/20191218125015_add_storage_version_to_snippets.rb b/db/migrate/20191218125015_add_storage_version_to_snippets.rb
new file mode 100644
index 00000000000..b1bd3589692
--- /dev/null
+++ b/db/migrate/20191218125015_add_storage_version_to_snippets.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class AddStorageVersionToSnippets < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+ disable_ddl_transaction!
+
+ def up
+ add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault
+ :snippets,
+ :storage_version,
+ :integer,
+ default: 2,
+ allow_null: false
+ )
+ end
+
+ def down
+ remove_column(:snippets, :storage_version)
+ end
+end
diff --git a/db/post_migrate/20200106071113_update_fingerprint_sha256_within_keys.rb b/db/post_migrate/20200106071113_update_fingerprint_sha256_within_keys.rb
new file mode 100644
index 00000000000..06f5c881006
--- /dev/null
+++ b/db/post_migrate/20200106071113_update_fingerprint_sha256_within_keys.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class UpdateFingerprintSha256WithinKeys < ActiveRecord::Migration[5.0]
+ include Gitlab::Database::MigrationHelpers
+
+ class Key < ActiveRecord::Base
+ include EachBatch
+
+ self.table_name = 'keys'
+ self.inheritance_column = :_type_disabled
+ end
+
+ disable_ddl_transaction!
+
+ def up
+ queue_background_migration_jobs_by_range_at_intervals(Key, 'MigrateFingerprintSha256WithinKeys', 5.minutes)
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 3cbeb00830a..3ead1f38ac3 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_02_170221) do
+ActiveRecord::Schema.define(version: 2020_01_06_071113) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@@ -3803,6 +3803,8 @@ ActiveRecord::Schema.define(version: 2020_01_02_170221) 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.integer "storage_version", default: 2, 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"