Changeset comments set to longtext for handling comments > 64KB with Mysql (#16143).
git-svn-id: http://svn.redmine.org/redmine/trunk@12944 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
b0ec39fc45
commit
2641f8ba91
|
@ -0,0 +1,12 @@
|
||||||
|
class ChangeChangesetsCommentsLimit < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
|
||||||
|
max_size = 16.megabytes
|
||||||
|
change_column :changesets, :comments, :text, :limit => max_size
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
# no-op
|
||||||
|
end
|
||||||
|
end
|
|
@ -536,6 +536,17 @@ class ChangesetTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_comments_should_accept_more_than_64k
|
||||||
|
c = Changeset.new(:repository => Repository.first,
|
||||||
|
:committed_on => Time.now,
|
||||||
|
:revision => '123',
|
||||||
|
:scmid => '12345',
|
||||||
|
:comments => "a" * 500.kilobyte)
|
||||||
|
assert c.save
|
||||||
|
c.reload
|
||||||
|
assert_equal 500.kilobyte, c.comments.size
|
||||||
|
end
|
||||||
|
|
||||||
def test_identifier
|
def test_identifier
|
||||||
c = Changeset.find_by_revision('1')
|
c = Changeset.find_by_revision('1')
|
||||||
assert_equal c.revision, c.identifier
|
assert_equal c.revision, c.identifier
|
||||||
|
|
Loading…
Reference in New Issue