Skip to content

Commit f601908

Browse files
committed
Add tests for aliased types
1 parent 892bdb5 commit f601908

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

activerecord/test/cases/schema_dumper_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ def test_schema_dump_does_not_include_limit_for_float_field
227227
assert_match %r{t\.float\s+"temperature"$}, output
228228
end
229229

230+
def test_schema_dump_aliased_types
231+
output = standard_dump
232+
assert_match %r{t\.binary\s+"blob_data"$}, output
233+
assert_match %r{t\.decimal\s+"numeric_number"}, output
234+
end
235+
230236
if ActiveRecord::Base.connection.supports_expression_index?
231237
def test_schema_dump_expression_indices
232238
index_definition = dump_table_schema("companies").split(/\n/).grep(/t\.index.*company_expression_index/).first.strip

activerecord/test/schema/schema.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
t.string :name
9494
t.binary :data
9595
t.binary :short_data, limit: 2048
96+
t.blob :blob_data
9697
end
9798

9899
create_table :birds, force: true do |t|
@@ -589,6 +590,7 @@
589590
t.decimal :my_house_population, precision: 2, scale: 0
590591
t.decimal :decimal_number
591592
t.decimal :decimal_number_with_default, precision: 3, scale: 2, default: 2.78
593+
t.numeric :numeric_number
592594
t.float :temperature
593595
t.decimal :decimal_number_big_precision, precision: 20
594596
# Oracle/SQLServer supports precision up to 38

0 commit comments

Comments
 (0)