Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rollback [6961] which breaks SQLite tests. Reference #7345.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6965 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 9b444fe73beaddccd5664d0e0f17f948f00680bf 1 parent 72401dc
@jeremy jeremy authored
View
2  activerecord/CHANGELOG
@@ -1,7 +1,5 @@
*SVN*
-* Migrations: raise if a column is duplicated. #7345 [Jeremy McAnally, Josh Peek]
-
* Fixtures: correctly delete and insert fixtures in a single transaction. #8553 [Michael Schuerig]
* Fixtures: people(:technomancy, :josh) returns both fixtures. #7880 [technomancy, Josh Peek]
View
3  activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -351,8 +351,7 @@ def [](name)
# There's a short-hand method for each of the type values declared at the top. And then there's
# TableDefinition#timestamps that'll add created_at and updated_at as datetimes.
def column(name, type, options = {})
- raise "You already defined column '#{name}'." if self[name]
- column = ColumnDefinition.new(@base, name, type)
+ column = self[name] || ColumnDefinition.new(@base, name, type)
column.limit = options[:limit] || native[type.to_sym][:limit] if options[:limit] or native[type.to_sym]
column.precision = options[:precision]
column.scale = options[:scale]
View
16 activerecord/test/migration_test.rb
@@ -807,22 +807,6 @@ def test_create_table_with_custom_sequence_name
end
end
- def test_should_disallow_duplicate_column_definition
- assert_raises(ActiveRecord::StatementInvalid) do
- Person.connection.add_column("people", "full_name", :string, :limit => 40)
- Person.connection.add_column("people", "full_name", :text)
- end
-
- assert_raises(RuntimeError) do
- Person.connection.create_table :people_with_errors do |t|
- t.column "full_name", :string, :limit => 40
- t.column "full_name", :text
- end
- end
-
- Person.reset_column_information
- end
-
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.