aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-04-03 14:59:53 +0200
committerYves Senn <yves.senn@gmail.com>2014-04-04 10:35:26 +0200
commitf4226c3ab6651f6871e02f3c6754c29ab155b938 (patch)
tree0f60b23911dc84929a3bf783be78c01d21bd857e /activerecord/test/schema
parent362203e8039328b2827f5ee8bc73af46000f1d78 (diff)
downloadrails-f4226c3ab6651f6871e02f3c6754c29ab155b938.tar.gz
rails-f4226c3ab6651f6871e02f3c6754c29ab155b938.tar.bz2
rails-f4226c3ab6651f6871e02f3c6754c29ab155b938.zip
PostgreSQL and SQLite, remove varchar limit. [Vladimir Sazhin & Toms Mikoss & Yves Senn]
There is no reason for the PG adapter to have a default limit of 255 on :string columns. See this snippet from the PG docs: Tip: There is no performance difference among these three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, there is no such advantage in PostgreSQL; in fact character(n) is usually the slowest of the three because of its additional storage costs. In most situations text or character varying should be used instead.
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/schema.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index a9c4980283..d79cce8cca 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -673,7 +673,7 @@ ActiveRecord::Schema.define do
end
create_table :topics, force: true do |t|
- t.string :title
+ t.string :title, limit: 250
t.string :author_name
t.string :author_email_address
if mysql_56?