diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-10 08:34:37 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-10 08:43:18 +0900 |
commit | c83254db7ad2dbcc73b3eb1e103ba2bae666ab91 (patch) | |
tree | 5d275fcfbbef1c3bcccbfbb2d355ab62ac9a7dae /activerecord/test/cases/migration | |
parent | ea0eaced55465ce8054cf54ff583d75272bd8505 (diff) | |
parent | 0914ea8477aab6620983cee9b51be4c2c574705f (diff) | |
download | rails-c83254db7ad2dbcc73b3eb1e103ba2bae666ab91.tar.gz rails-c83254db7ad2dbcc73b3eb1e103ba2bae666ab91.tar.bz2 rails-c83254db7ad2dbcc73b3eb1e103ba2bae666ab91.zip |
Merge pull request #35203 from chiastolite/add_column_without_column_names
Do not allow to add column without column name
Diffstat (limited to 'activerecord/test/cases/migration')
-rw-r--r-- | activerecord/test/cases/migration/columns_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration/columns_test.rb b/activerecord/test/cases/migration/columns_test.rb index cedd9c44e3..1c66c8186f 100644 --- a/activerecord/test/cases/migration/columns_test.rb +++ b/activerecord/test/cases/migration/columns_test.rb @@ -318,6 +318,17 @@ module ActiveRecord ensure connection.drop_table(:my_table) rescue nil end + + def test_add_column_without_column_name + e = assert_raise ArgumentError do + connection.create_table "my_table", force: true do |t| + t.timestamp + end + end + assert_equal "Missing column name(s) for timestamp", e.message + ensure + connection.drop_table :my_table, if_exists: true + end end end end |