From 6be637440304076734700644f73d994dbd5225f8 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Tue, 6 Dec 2016 09:27:04 +0900 Subject: [PATCH] Should be sync the `primary_key` definition with actually created Actually the `primary_key` definition is not used but the inconsistency is confusing. Actual definition is `bigint auto_increment PRIMARY KEY` so `UNSIGNED` and `(8)` is unnecessary. See also #21607. --- .../active_record/connection_adapters/abstract_mysql_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 971b274265..684176fead 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -39,7 +39,7 @@ module ActiveRecord self.emulate_booleans = true NATIVE_DATABASE_TYPES = { - primary_key: "BIGINT(8) UNSIGNED auto_increment PRIMARY KEY", + primary_key: "bigint auto_increment PRIMARY KEY", string: { name: "varchar", limit: 255 }, text: { name: "text", limit: 65535 }, integer: { name: "int", limit: 4 },