diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-11-04 11:37:49 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-04 18:41:27 +0100 |
commit | 9c66b78cdcdd85c9d9023dbfa8914d5748279e19 (patch) | |
tree | f2f95d6323a1a0737a890d9d3e01ec8e940bf320 /db | |
parent | aca7d01ddde166f955265a311590fa20c6f35d1c (diff) | |
download | gitlab-ce-9c66b78cdcdd85c9d9023dbfa8914d5748279e19.tar.gz |
Merge branch '24059-round-robin-repository-storage' into 'master'
Resolve "Introduce round-robin project creation to spread load over multiple shards"
Allow multiple shards to be enabled in the admin settings page, balancing project creation across all enabled shards.
* `f.select ..., multiple: true` isn't the most beautiful UI in the world, but switching to `collection_check_boxes` (or a facsimile thereof) isn't trivial
* Should `pick_repository_storage` be a method of `ApplicationSetting`, or `Project`? It's going to accrete logic over time so perhaps it should be its own class already?
* This is written to avoid the need for a database migration, so it is`serialize :repository_storage` without `, Array`. This is tested, but alternatives include:
* Add a database migration
* Write a custom Coder that will accept a String or Array in `load` and always `dump an Array.
Closes #24059
See merge request !7273
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20161103171205_rename_repository_storage_column.rb | 29 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 31 insertions, 2 deletions
diff --git a/db/migrate/20161103171205_rename_repository_storage_column.rb b/db/migrate/20161103171205_rename_repository_storage_column.rb new file mode 100644 index 00000000000..e9f992793b4 --- /dev/null +++ b/db/migrate/20161103171205_rename_repository_storage_column.rb @@ -0,0 +1,29 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RenameRepositoryStorageColumn < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + # When a migration requires downtime you **must** uncomment the following + # constant and define a short and easy to understand explanation as to why the + # migration requires downtime. + # DOWNTIME_REASON = '' + + # When using the methods "add_concurrent_index" or "add_column_with_default" + # you must disable the use of transactions as these methods can not run in an + # existing transaction. When using "add_concurrent_index" make sure that this + # method is the _only_ method called in the migration, any other changes + # should go in a separate migration. This ensures that upon failure _only_ the + # index creation fails and can be retried or reverted easily. + # + # To disable transactions uncomment the following line and remove these + # comments: + # disable_ddl_transaction! + + def change + rename_column :application_settings, :repository_storage, :repository_storages + end +end diff --git a/db/schema.rb b/db/schema.rb index 02282b0f666..a5f5f812f0d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20161024042317) do +ActiveRecord::Schema.define(version: 20161103171205) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -88,7 +88,7 @@ ActiveRecord::Schema.define(version: 20161024042317) do t.integer "container_registry_token_expire_delay", default: 5 t.text "after_sign_up_text" t.boolean "user_default_external", default: false, null: false - t.string "repository_storage", default: "default" + t.string "repository_storages", default: "default" t.string "enabled_git_access_protocol" t.boolean "domain_blacklist_enabled", default: false t.text "domain_blacklist" |