Merge branch '31647-fix-snippet-content_html' into 'master'
Fix caching large snippet HTML content on MySQL databases Closes #31647 See merge request !11024
This commit is contained in:
commit
8983ade27d
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Fix caching large snippet HTML content on MySQL databases
|
||||
merge_request: 11024
|
||||
author:
|
|
@ -0,0 +1,2 @@
|
|||
# rubocop:disable all
|
||||
require_relative 'markdown_cache_limits_to_mysql'
|
|
@ -0,0 +1,13 @@
|
|||
class MarkdownCacheLimitsToMysql < ActiveRecord::Migration
|
||||
DOWNTIME = false
|
||||
|
||||
def up
|
||||
return unless Gitlab::Database.mysql?
|
||||
|
||||
change_column :snippets, :content_html, :text, limit: 2147483647
|
||||
end
|
||||
|
||||
def down
|
||||
# no-op
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20170426181740) do
|
||||
ActiveRecord::Schema.define(version: 20170502091007) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
|
@ -65,6 +65,7 @@ namespace :gitlab do
|
|||
migrations = `git diff #{ref}.. --diff-filter=A --name-only -- db/migrate`.lines
|
||||
.map { |file| Rails.root.join(file.strip).to_s }
|
||||
.select { |file| File.file?(file) }
|
||||
.select { |file| /\A[0-9]+.*\.rb\z/ =~ File.basename(file) }
|
||||
|
||||
Gitlab::DowntimeCheck.new.check_and_print(migrations)
|
||||
end
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
require Rails.root.join('db/migrate/limits_to_mysql')
|
||||
require Rails.root.join('db/migrate/markdown_cache_limits_to_mysql')
|
||||
|
||||
desc "GitLab | Add limits to strings in mysql database"
|
||||
task add_limits_mysql: :environment do
|
||||
puts "Adding limits to schema.rb for mysql"
|
||||
LimitsToMysql.new.up
|
||||
MarkdownCacheLimitsToMysql.new.up
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue