instance method primary_key

Ruby on Rails 5.0.7.2

Since v5.0.7.2 Last seen in v5.1.7

Available in: v5.0.7.2 v5.1.7

Signature

primary_key(name, type = :primary_key, **options)

No documentation comment.

Parameters

name req
type opt = :primary_key
options keyrest
Source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 5
        def primary_key(name, type = :primary_key, **options)
          options[:auto_increment] = true if type == :bigint && !options.key?(:default)
          super
        end

Defined in activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb line 5 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::MySQL::ColumnMethods

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close