aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-03-27 11:05:21 +0100
committerJosé Valim <jose.valim@gmail.com>2010-03-27 11:05:37 +0100
commit0cb3311d06c02649fb7444c34b6fdf2214ab85f5 (patch)
tree52189d3bd24cafac4702bf01e18563030026f7e7 /activerecord/test
parentf1da7174cc66d70fe8e7352761873f9ff05ca8fa (diff)
downloadrails-0cb3311d06c02649fb7444c34b6fdf2214ab85f5.tar.gz
rails-0cb3311d06c02649fb7444c34b6fdf2214ab85f5.tar.bz2
rails-0cb3311d06c02649fb7444c34b6fdf2214ab85f5.zip
Revert "primary_key now supports :limit. [#876 state:resolved]" since it broke AR test suite.
This reverts commit 41e5c7ed44fedb95636ef9b7a792c46ea03309bd.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/schema_dumper_test.rb11
-rw-r--r--activerecord/test/schema/schema.rb4
2 files changed, 2 insertions, 13 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb
index 95039289c4..1c43e3c5b5 100644
--- a/activerecord/test/cases/schema_dumper_test.rb
+++ b/activerecord/test/cases/schema_dumper_test.rb
@@ -45,7 +45,7 @@ class SchemaDumperTest < ActiveRecord::TestCase
next if column_set.empty?
lengths = column_set.map do |column|
- if match = column.match(/t\.(?:integer|decimal|float|datetime|timestamp|time|date|text|binary|string|boolean|primary_key)\s+"/)
+ if match = column.match(/t\.(?:integer|decimal|float|datetime|timestamp|time|date|text|binary|string|boolean)\s+"/)
match[0].length
end
end
@@ -169,13 +169,6 @@ class SchemaDumperTest < ActiveRecord::TestCase
assert_match %r(:primary_key => "movieid"), match[1], "non-standard primary key not preserved"
end
- def test_mysql_schema_dump_should_honor_primary_keys_limits
- output = standard_dump
- match = output.match(%r{create_table "primary_key_limit",.*?:id => false\b.*? do (.*?)\bend$}m)
- assert_not_nil(match, output)
- assert_match %r(t.primary_key\s+"id",\s+:limit => \d+$), match[1], "limit option not found on primary key"
- end
-
if current_adapter?(:MysqlAdapter)
def test_schema_dump_should_not_add_default_value_for_mysql_text_field
output = standard_dump
@@ -218,7 +211,7 @@ class SchemaDumperTest < ActiveRecord::TestCase
if current_adapter?(:OracleAdapter)
assert_match %r{t.integer\s+"atoms_in_universe",\s+:precision => 38,\s+:scale => 0}, output
else
- assert_match %r{t.decimal\s+"atoms_in_universe",\s+:limit => 55,\s+:precision => 55,\s+:scale => 0}, output
+ assert_match %r{t.decimal\s+"atoms_in_universe",\s+:precision => 55,\s+:scale => 0}, output
end
end
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index a1932ad16a..bec4291457 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -394,10 +394,6 @@ ActiveRecord::Schema.define do
t.integer :price
end
- create_table :primary_key_limit, :force => true, :id => false do |t|
- t.primary_key :id, :limit => 8
- end
-
create_table :projects, :force => true do |t|
t.string :name
t.string :type