Skip to content

Commit 8b0c807

Browse files
committed
Sync mysql2 and trilogy specific schema
Follow up to rails#50733. ``` % diff -ub test/schema/mysql2_specific_schema.rb test/schema/trilogy_specific_schema.rb --- test/schema/mysql2_specific_schema.rb 2024-09-07 19:53:07 +++ test/schema/trilogy_specific_schema.rb 2024-09-07 19:50:17 @@ -21,7 +21,6 @@ t.string :char2, limit: 50, default: "a varchar field" if ActiveRecord::TestCase.supports_default_expression? t.binary :uuid, limit: 36, default: -> { "(uuid())" } - t.string :char2_concatenated, default: -> { "(concat(`char2`, '-'))" } end end ```
1 parent e58a1a1 commit 8b0c807

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

activerecord/test/cases/defaults_test.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,9 @@ class MysqlDefaultExpressionTest < ActiveRecord::TestCase
176176
assert_match %r/t\.binary\s+"uuid",\s+limit: 36,\s+default: -> { "\(?uuid\(\)\)?" }/i, output
177177
end
178178

179-
if current_adapter?(:Mysql2Adapter)
180-
test "schema dump includes default expression with single quotes reflected correctly" do
181-
output = dump_table_schema("defaults")
182-
assert_match %r/t\.string\s+"char2_concatenated",\s+default: -> { "\(?concat\(`char2`,(_utf8mb4)?'-'\)\)?" }/i, output
183-
end
179+
test "schema dump includes default expression with single quotes reflected correctly" do
180+
output = dump_table_schema("defaults")
181+
assert_match %r/t\.string\s+"char2_concatenated",\s+default: -> { "\(?concat\(`char2`,(_utf8mb4)?'-'\)\)?" }/i, output
184182
end
185183
end
186184

activerecord/test/schema/trilogy_specific_schema.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
t.string :char2, limit: 50, default: "a varchar field"
2222
if ActiveRecord::TestCase.supports_default_expression?
2323
t.binary :uuid, limit: 36, default: -> { "(uuid())" }
24+
t.string :char2_concatenated, default: -> { "(concat(`char2`, '-'))" }
2425
end
2526
end
2627

0 commit comments

Comments
 (0)