diff options
author | Max Lapshin <max@maxidoors.ru> | 2009-04-20 19:47:31 +0400 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-04-21 11:44:13 +0100 |
commit | f3ac4f387dd748db349ec217030d2b13260516f1 (patch) | |
tree | 9f7bebcd267c68ff929f516700e91149552daab9 /activerecord/test | |
parent | 64b33b6cf9db508d2c12394cc1a3f36c91fb2eed (diff) | |
download | rails-f3ac4f387dd748db349ec217030d2b13260516f1.tar.gz rails-f3ac4f387dd748db349ec217030d2b13260516f1.tar.bz2 rails-f3ac4f387dd748db349ec217030d2b13260516f1.zip |
Fixed dumping from postgresql columns in index in wrong order. [#2515 state:resolved]
Signed-off-by: Tarmo Tänav <tarmo@itech.ee>
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 5 | ||||
-rw-r--r-- | activerecord/test/schema/schema.rb | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index 0b1a075b98..f9ad7f3ba3 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -152,6 +152,11 @@ class SchemaDumperTest < ActiveRecord::TestCase end end + def test_schema_dumps_index_columns_in_right_order + index_definition = standard_dump.split(/\n/).grep(/add_index.*companies/).first.strip + assert_equal 'add_index "companies", ["firm_id", "type", "rating", "ruby_type"], :name => "company_index"', index_definition + end + if current_adapter?(:MysqlAdapter) def test_schema_dump_should_not_add_default_value_for_mysql_text_field output = standard_dump diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index 3b073b0888..98e6d192a5 100644 --- a/activerecord/test/schema/schema.rb +++ b/activerecord/test/schema/schema.rb @@ -118,6 +118,8 @@ ActiveRecord::Schema.define do t.integer :rating, :default => 1 end + add_index :companies, [:firm_id, :type, :rating, :ruby_type], :name => "company_index" + create_table :computers, :force => true do |t| t.integer :developer, :null => false t.integer :extendedWarranty, :null => false |