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:
parent
ff807f823b
commit
6d2105bb63
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue