To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / db / migrate / 20091227112908_change_wiki_contents_text_limit.rb @ 912:5e80956cc792
History | View | Annotate | Download (515 Bytes)
| 1 |
class ChangeWikiContentsTextLimit < ActiveRecord::Migration |
|---|---|
| 2 |
def self.up |
| 3 |
# Migrates MySQL databases only
|
| 4 |
# Postgres would raise an error (see http://dev.rubyonrails.org/ticket/3818)
|
| 5 |
# Not fixed in Rails 2.3.5
|
| 6 |
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i |
| 7 |
max_size = 16.megabytes
|
| 8 |
change_column :wiki_contents, :text, :text, :limit => max_size |
| 9 |
change_column :wiki_content_versions, :data, :binary, :limit => max_size |
| 10 |
end
|
| 11 |
end
|
| 12 |
|
| 13 |
def self.down |
| 14 |
# no-op
|
| 15 |
end
|
| 16 |
end
|