From dbe03f5443557958d0cd329a47ffeba1b350029e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 2 Mar 2014 09:34:00 +0000 Subject: [PATCH] Merged r12944 (#16143). git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@12947 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- ...0140228130325_change_changesets_comments_limit.rb | 12 ++++++++++++ test/unit/changeset_test.rb | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 db/migrate/20140228130325_change_changesets_comments_limit.rb diff --git a/db/migrate/20140228130325_change_changesets_comments_limit.rb b/db/migrate/20140228130325_change_changesets_comments_limit.rb new file mode 100644 index 000000000..dccc23757 --- /dev/null +++ b/db/migrate/20140228130325_change_changesets_comments_limit.rb @@ -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 diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb index 9a11eeab4..5ee508083 100644 --- a/test/unit/changeset_test.rb +++ b/test/unit/changeset_test.rb @@ -536,6 +536,17 @@ class ChangesetTest < ActiveSupport::TestCase 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 c = Changeset.find_by_revision('1') assert_equal c.revision, c.identifier -- 2.39.5