0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rails5.1でprimary keyがBigIntにならない

Posted at

rails 5.1からデフォルトでprimary keyがbigintになると聞いたけど、自分の環境ではbigintにならず、4bytes以上のidを保存しようとすると以下のようなエラーが出た。

rails 5.1 activemodel::type::integer with limit 4 bytes

色々調べた結果、SQLiteは対応してない模様。PostgreSQLとMySQLのみに対応しているとのこと。

【参考】 https://github.com/rails/rails/pull/26266

Per a conversation with @sgrif: changes default primary keys from
Integer to BIGINT for both Postgresql and MySQL. Leaves behavior
alone for SQLite since this database does not provide support for
BIGINT primary keys.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?