From 3c571baf5d8e2a81f8722a3b5cd38ae1f51988d8 Mon Sep 17 00:00:00 2001 From: James Edwards-Jones Date: Thu, 2 Feb 2017 17:28:53 +0000 Subject: =?UTF-8?q?Use=20non-downtime=20migration=20for=20ApplicationSetti?= =?UTF-8?q?ng=E2=80=99s=20max=5Fpages=5Fsize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...215132013_add_pages_size_to_application_settings.rb | 11 ++++++++++- db/migrate/20160210105555_create_pages_domain.rb | 2 ++ db/schema.rb | 18 +++++++++--------- 3 files changed, 21 insertions(+), 10 deletions(-) (limited to 'db') diff --git a/db/migrate/20151215132013_add_pages_size_to_application_settings.rb b/db/migrate/20151215132013_add_pages_size_to_application_settings.rb index e7fb73190e8..f3a663f805b 100644 --- a/db/migrate/20151215132013_add_pages_size_to_application_settings.rb +++ b/db/migrate/20151215132013_add_pages_size_to_application_settings.rb @@ -1,5 +1,14 @@ class AddPagesSizeToApplicationSettings < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + disable_ddl_transaction! + + DOWNTIME = false + def up - add_column :application_settings, :max_pages_size, :integer, default: 100, null: false + add_column_with_default :application_settings, :max_pages_size, :integer, default: 100, allow_null: false + end + + def down + remove_column(:application_settings, :max_pages_size) end end diff --git a/db/migrate/20160210105555_create_pages_domain.rb b/db/migrate/20160210105555_create_pages_domain.rb index 9af206143bd..0e8507c7e9a 100644 --- a/db/migrate/20160210105555_create_pages_domain.rb +++ b/db/migrate/20160210105555_create_pages_domain.rb @@ -1,4 +1,6 @@ class CreatePagesDomain < ActiveRecord::Migration + DOWNTIME = false + def change create_table :pages_domains do |t| t.integer :project_id diff --git a/db/schema.rb b/db/schema.rb index dc3d8c22e8d..9863367e312 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -61,7 +61,6 @@ ActiveRecord::Schema.define(version: 20170130204620) do t.boolean "shared_runners_enabled", default: true, null: false t.integer "max_artifacts_size", default: 100, null: false t.string "runners_registration_token" - t.integer "max_pages_size", default: 100, null: false t.boolean "require_two_factor_authentication", default: false t.integer "two_factor_grace_period", default: 48 t.boolean "metrics_enabled", default: false @@ -99,17 +98,18 @@ ActiveRecord::Schema.define(version: 20170130204620) do t.text "help_page_text_html" t.text "shared_runners_text_html" t.text "after_sign_up_text_html" - t.boolean "sidekiq_throttling_enabled", default: false - t.string "sidekiq_throttling_queues" - t.decimal "sidekiq_throttling_factor" t.boolean "housekeeping_enabled", default: true, null: false t.boolean "housekeeping_bitmaps_enabled", default: true, null: false t.integer "housekeeping_incremental_repack_period", default: 10, null: false t.integer "housekeeping_full_repack_period", default: 50, null: false t.integer "housekeeping_gc_period", default: 200, null: false + t.boolean "sidekiq_throttling_enabled", default: false + t.string "sidekiq_throttling_queues" + t.decimal "sidekiq_throttling_factor" t.boolean "html_emails_enabled", default: true t.string "plantuml_url" t.boolean "plantuml_enabled" + t.integer "max_pages_size", default: 100, null: false end create_table "audit_events", force: :cascade do |t| @@ -857,11 +857,11 @@ ActiveRecord::Schema.define(version: 20170130204620) do create_table "pages_domains", force: :cascade do |t| t.integer "project_id" - t.text "certificate" - t.text "encrypted_key" - t.string "encrypted_key_iv" - t.string "encrypted_key_salt" - t.string "domain" + t.text "certificate" + t.text "encrypted_key" + t.string "encrypted_key_iv" + t.string "encrypted_key_salt" + t.string "domain" end add_index "pages_domains", ["domain"], name: "index_pages_domains_on_domain", unique: true, using: :btree -- cgit v1.2.3