Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
1a168dc7
Commit
1a168dc7
authored
May 02, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix caching large snippet HTML content on MySQL databases
parent
6201f4c2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
1 deletion
+23
-1
changelogs/unreleased/31647-fix-snippet-content_html.yml
changelogs/unreleased/31647-fix-snippet-content_html.yml
+4
-0
db/migrate/20170502091007_markdown_cache_limits_to_mysql.rb
db/migrate/20170502091007_markdown_cache_limits_to_mysql.rb
+2
-0
db/migrate/markdown_cache_limits_to_mysql.rb
db/migrate/markdown_cache_limits_to_mysql.rb
+13
-0
db/schema.rb
db/schema.rb
+1
-1
lib/tasks/gitlab/db.rake
lib/tasks/gitlab/db.rake
+1
-0
lib/tasks/migrate/add_limits_mysql.rake
lib/tasks/migrate/add_limits_mysql.rake
+2
-0
No files found.
changelogs/unreleased/31647-fix-snippet-content_html.yml
0 → 100644
View file @
1a168dc7
---
title
:
Fix caching large snippet HTML content on MySQL databases
merge_request
:
11024
author
:
db/migrate/20170502091007_markdown_cache_limits_to_mysql.rb
0 → 100644
View file @
1a168dc7
# rubocop:disable all
require_relative
'markdown_cache_limits_to_mysql'
db/migrate/markdown_cache_limits_to_mysql.rb
0 → 100644
View file @
1a168dc7
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
db/schema.rb
View file @
1a168dc7
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20170
426181740
)
do
ActiveRecord
::
Schema
.
define
(
version:
20170
502091007
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
lib/tasks/gitlab/db.rake
View file @
1a168dc7
...
...
@@ -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
...
...
lib/tasks/migrate/add_limits_mysql.rake
View file @
1a168dc7
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment