@@ -0,0 +1,12 | |||
|
1 | class ChangeChangesetsCommentsLimit < ActiveRecord::Migration | |
|
2 | def up | |
|
3 | if ActiveRecord::Base.connection.adapter_name =~ /mysql/i | |
|
4 | max_size = 16.megabytes | |
|
5 | change_column :changesets, :comments, :text, :limit => max_size | |
|
6 | end | |
|
7 | end | |
|
8 | ||
|
9 | def down | |
|
10 | # no-op | |
|
11 | end | |
|
12 | end |
@@ -536,6 +536,17 class ChangesetTest < ActiveSupport::TestCase | |||
|
536 | 536 | end |
|
537 | 537 | end |
|
538 | 538 | |
|
539 | def test_comments_should_accept_more_than_64k | |
|
540 | c = Changeset.new(:repository => Repository.first, | |
|
541 | :committed_on => Time.now, | |
|
542 | :revision => '123', | |
|
543 | :scmid => '12345', | |
|
544 | :comments => "a" * 500.kilobyte) | |
|
545 | assert c.save | |
|
546 | c.reload | |
|
547 | assert_equal 500.kilobyte, c.comments.size | |
|
548 | end | |
|
549 | ||
|
539 | 550 | def test_identifier |
|
540 | 551 | c = Changeset.find_by_revision('1') |
|
541 | 552 | assert_equal c.revision, c.identifier |
General Comments 0
You need to be logged in to leave comments.
Login now