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:
parent
f4226c3ab6
commit
80f4a65bbd
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue