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.
This commit is contained in:
David A. Lee 2019-01-09 16:29:56 -05:00 committed by GitHub
parent ff807f823b
commit 6d2105bb63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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: