提交 36e6a516 编写于 作者: R Ryuta Kamizono

Fix CI failures due to MySQL 8.0.19 no longer output integer display width...

Fix CI failures due to MySQL 8.0.19 no longer output integer display width unless ZEROFILL is also used

https://buildkite.com/rails/rails/builds/66475#7a6c54bc-4ed3-4676-b196-4fee031f43bf

Fixes #38226.
上级 1d640204
......@@ -77,11 +77,14 @@ def test_errors_for_bigint_fks_on_integer_pk_table_in_alter_table
@conn.add_foreign_key :engines, :old_cars
end
assert_includes error.message, <<~MSG.squish
Column `old_car_id` on table `engines` does not match column `id` on `old_cars`,
which has type `int(11)`. To resolve this issue, change the type of the `old_car_id`
column on `engines` to be :integer. (For example `t.integer :old_car_id`).
MSG
assert_match(
%r/Column `old_car_id` on table `engines` does not match column `id` on `old_cars`, which has type `int(\(11\))?`\./,
error.message
)
assert_match(
%r/To resolve this issue, change the type of the `old_car_id` column on `engines` to be :integer\. \(For example `t.integer :old_car_id`\)\./,
error.message
)
assert_not_nil error.cause
ensure
@conn.execute("ALTER TABLE engines DROP COLUMN old_car_id") rescue nil
......@@ -101,11 +104,14 @@ def test_errors_for_bigint_fks_on_integer_pk_table_in_create_table
SQL
end
assert_includes error.message, <<~MSG.squish
Column `old_car_id` on table `foos` does not match column `id` on `old_cars`,
which has type `int(11)`. To resolve this issue, change the type of the `old_car_id`
column on `foos` to be :integer. (For example `t.integer :old_car_id`).
MSG
assert_match(
%r/Column `old_car_id` on table `foos` does not match column `id` on `old_cars`, which has type `int(\(11\))?`\./,
error.message
)
assert_match(
%r/To resolve this issue, change the type of the `old_car_id` column on `foos` to be :integer\. \(For example `t.integer :old_car_id`\)\./,
error.message
)
assert_not_nil error.cause
ensure
@conn.drop_table :foos, if_exists: true
......@@ -125,11 +131,14 @@ def test_errors_for_integer_fks_on_bigint_pk_table_in_create_table
SQL
end
assert_includes error.message, <<~MSG.squish
Column `car_id` on table `foos` does not match column `id` on `cars`,
which has type `bigint(20)`. To resolve this issue, change the type of the `car_id`
column on `foos` to be :bigint. (For example `t.bigint :car_id`).
MSG
assert_match(
%r/Column `car_id` on table `foos` does not match column `id` on `cars`, which has type `bigint(\(20\))?`\./,
error.message
)
assert_match(
%r/To resolve this issue, change the type of the `car_id` column on `foos` to be :bigint\. \(For example `t.bigint :car_id`\)\./,
error.message
)
assert_not_nil error.cause
ensure
@conn.drop_table :foos, if_exists: true
......
......@@ -144,10 +144,10 @@ def test_create_table_with_limits
assert_equal "integer", four.sql_type
assert_equal "bigint", eight.sql_type
elsif current_adapter?(:Mysql2Adapter)
assert_match "int(11)", default.sql_type
assert_match "tinyint", one.sql_type
assert_match "int", four.sql_type
assert_match "bigint", eight.sql_type
assert_match %r/\Aint/, default.sql_type
assert_match %r/\Atinyint/, one.sql_type
assert_match %r/\Aint/, four.sql_type
assert_match %r/\Abigint/, eight.sql_type
elsif current_adapter?(:OracleAdapter)
assert_equal "NUMBER(38)", default.sql_type
assert_equal "NUMBER(1)", one.sql_type
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册