From 3c2b4a1cede956d5160ccf08d0a561bf31248161 Mon Sep 17 00:00:00 2001 From: Ahmad Sherif Date: Mon, 22 Jul 2019 16:56:40 +0200 Subject: Enable serving static objects from an external storage It consists of two parts: 1. Redirecting users to the configured external storage 1. Allowing the external storage to request the static object(s) on behalf of the user by means of specific tokens Part of https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/6829 --- ...432_add_index_to_index_on_static_object_token.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 db/migrate/20190725183432_add_index_to_index_on_static_object_token.rb (limited to 'db/migrate/20190725183432_add_index_to_index_on_static_object_token.rb') diff --git a/db/migrate/20190725183432_add_index_to_index_on_static_object_token.rb b/db/migrate/20190725183432_add_index_to_index_on_static_object_token.rb new file mode 100644 index 00000000000..423c45b9543 --- /dev/null +++ b/db/migrate/20190725183432_add_index_to_index_on_static_object_token.rb @@ -0,0 +1,21 @@ +# 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 AddIndexToIndexOnStaticObjectToken < 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_concurrent_index :users, :static_object_token, unique: true + end + + def down + remove_concurrent_index :users, :static_object_token + end +end -- cgit v1.2.1