Add tests for aliased types
This commit is contained in:
parent
892bdb546d
commit
f601908738
|
@ -227,6 +227,12 @@ class SchemaDumperTest < ActiveRecord::TestCase
|
|||
assert_match %r{t\.float\s+"temperature"$}, output
|
||||
end
|
||||
|
||||
def test_schema_dump_aliased_types
|
||||
output = standard_dump
|
||||
assert_match %r{t\.binary\s+"blob_data"$}, output
|
||||
assert_match %r{t\.decimal\s+"numeric_number"}, output
|
||||
end
|
||||
|
||||
if ActiveRecord::Base.connection.supports_expression_index?
|
||||
def test_schema_dump_expression_indices
|
||||
index_definition = dump_table_schema("companies").split(/\n/).grep(/t\.index.*company_expression_index/).first.strip
|
||||
|
|
|
@ -93,6 +93,7 @@ ActiveRecord::Schema.define do
|
|||
t.string :name
|
||||
t.binary :data
|
||||
t.binary :short_data, limit: 2048
|
||||
t.blob :blob_data
|
||||
end
|
||||
|
||||
create_table :birds, force: true do |t|
|
||||
|
@ -589,6 +590,7 @@ ActiveRecord::Schema.define do
|
|||
t.decimal :my_house_population, precision: 2, scale: 0
|
||||
t.decimal :decimal_number
|
||||
t.decimal :decimal_number_with_default, precision: 3, scale: 2, default: 2.78
|
||||
t.numeric :numeric_number
|
||||
t.float :temperature
|
||||
t.decimal :decimal_number_big_precision, precision: 20
|
||||
# Oracle/SQLServer supports precision up to 38
|
||||
|
|
Loading…
Reference in New Issue