summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2018-09-24 12:30:49 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2018-10-01 11:58:21 -0300
commit4fbca2a346dc4c2c2c57e6a5bc3d13a8c3eeb23e (patch)
tree85ac3e8ffe36470fa4fa424c58e372d585417f03 /db
parent4d4522c15860529693305dc0fc0231c22eaf8a31 (diff)
downloadgitlab-ce-4fbca2a346dc4c2c2c57e6a5bc3d13a8c3eeb23e.tar.gz
Make single diff patch limit configurableosw-configurable-single-diff-file-limit
- Creates a new column to hold the single patch limit value on application_settings - Allows updating this value through the application_settings API - Calculates single diff patch collapsing limit based on diff_max_patch_bytes column - Updates diff limit documentation - Adds documentation (with warning) as of how one can update this limit
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180924141949_add_diff_max_patch_bytes_to_application_settings.rb25
-rw-r--r--db/schema.rb3
2 files changed, 27 insertions, 1 deletions
diff --git a/db/migrate/20180924141949_add_diff_max_patch_bytes_to_application_settings.rb b/db/migrate/20180924141949_add_diff_max_patch_bytes_to_application_settings.rb
new file mode 100644
index 00000000000..084dfc65ce5
--- /dev/null
+++ b/db/migrate/20180924141949_add_diff_max_patch_bytes_to_application_settings.rb
@@ -0,0 +1,25 @@
+# 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 AddDiffMaxPatchBytesToApplicationSettings < ActiveRecord::Migration
+ 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(:application_settings,
+ :diff_max_patch_bytes,
+ :integer,
+ default: 100.kilobytes,
+ allow_null: false)
+ end
+
+ def down
+ remove_column(:application_settings, :diff_max_patch_bytes)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index f92d8005dfb..2e0152af81d 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: 20180917172041) do
+ActiveRecord::Schema.define(version: 20180924141949) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -171,6 +171,7 @@ ActiveRecord::Schema.define(version: 20180917172041) do
t.boolean "user_show_add_ssh_key_message", default: true, null: false
t.integer "usage_stats_set_by_user_id"
t.integer "receive_max_input_size"
+ t.integer "diff_max_patch_bytes", default: 102400, null: false
end
create_table "audit_events", force: :cascade do |t|