diff options
author | Elomar França <elomar@maisweb.org> | 2009-09-27 13:42:13 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-16 10:45:26 +0200 |
commit | edec1afe25014749f0e2df86d27477b45586a9e3 (patch) | |
tree | c644f7fd5170452c51c772393e7c406b402d71bc /activerecord/test/cases/migration_test.rb | |
parent | 3afdfc35e8aec7e6379e093dd1278cb3de54f21b (diff) | |
download | rails-edec1afe25014749f0e2df86d27477b45586a9e3.tar.gz rails-edec1afe25014749f0e2df86d27477b45586a9e3.tar.bz2 rails-edec1afe25014749f0e2df86d27477b45586a9e3.zip |
Don't carry default value when changing column for a binary type on MySQL [#3234 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/cases/migration_test.rb')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index f67344445a..41e27bd281 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -860,6 +860,16 @@ if ActiveRecord::Base.connection.supports_migrations? assert_equal "Tester", Person.new.first_name end + def test_change_column_type_default_should_change + old_columns = Person.connection.columns(Person.table_name, "#{name} Columns") + assert !old_columns.find { |c| c.name == 'data' } + + assert_nothing_raised do + Person.connection.add_column "people", "data", :string, :default => '' + Person.connection.change_column "people", "data", :binary + end + end + def test_change_column_quotes_column_names Person.connection.create_table :testings do |t| t.column :select, :string |