1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

test, show current adapter behavior for add_column limit: nil.

This is an illustration of https://github.com/rails/rails/pull/13435#issuecomment-33789752
Removing the limit from the PG and SQLite adapter solves the issue.
MySQL is still affected by the issue.
This commit is contained in:
Yves Senn 2014-04-04 09:16:02 +02:00
parent f4226c3ab6
commit 80f4a65bbd

View file

@ -35,6 +35,14 @@ module ActiveRecord
assert_no_column TestModel, :last_name
end
def test_add_column_without_limit
# TODO: limit: nil should work with all adapters.
skip "MySQL wrongly enforces a limit of 255" if current_adapter?(:MysqlAdapter, :Mysql2Adapter)
add_column :test_models, :description, :string, limit: nil
TestModel.reset_column_information
assert_nil TestModel.columns_hash["description"].limit
end
if current_adapter?(:MysqlAdapter, :Mysql2Adapter)
def test_unabstracted_database_dependent_types
add_column :test_models, :intelligence_quotient, :tinyint