aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorDavid A. Lee <david7lee@gmail.com>2019-01-09 16:29:56 -0500
committerGitHub <noreply@github.com>2019-01-09 16:29:56 -0500
commit6d2105bb6327d75b936f09cd4c34222d82e9e722 (patch)
tree36936466dbcab479c52a20161216ac96f721ae96 /guides
parentff807f823b869d3491935a096183ee2bebd58e7b (diff)
downloadrails-6d2105bb6327d75b936f09cd4c34222d82e9e722.tar.gz
rails-6d2105bb6327d75b936f09cd4c34222d82e9e722.tar.bz2
rails-6d2105bb6327d75b936f09cd4c34222d82e9e722.zip
Specify the type for the auto-generated primary key
Given the change to using `bigint` as type for auto-generated primary keys (as per https://github.com/rails/rails/pull/26266), I propose updating the Active Record Basics guide to explicitly state the type being used so as to avoid confusion as to the type of integer used, especially as the type can vary depending on the database used.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_record_basics.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/source/active_record_basics.md b/guides/source/active_record_basics.md
index a67e2924d7..b0d4bbd2c0 100644
--- a/guides/source/active_record_basics.md
+++ b/guides/source/active_record_basics.md
@@ -105,9 +105,9 @@ depending on the purpose of these columns.
fields that Active Record will look for when you create associations between
your models.
* **Primary keys** - By default, Active Record will use an integer column named
- `id` as the table's primary key. When using [Active Record
- Migrations](active_record_migrations.html) to create your tables, this column will be
- automatically created.
+ `id` as the table's primary key (`bigint` for Postgres and MYSQL, `integer`
+ for SQLite). When using [Active Record Migrations](active_record_migrations.html)
+ to create your tables, this column will be automatically created.
There are also some optional column names that will add additional features
to Active Record instances: