Module: ActiveRecord::ConnectionAdapters::ColumnMethods
- Extended by:
- ActiveSupport::Concern
- Included in:
- Table, TableDefinition
- Defined in:
- lib/active_record/connection_adapters/abstract/schema_definitions.rb
Instance Method Summary collapse
-
#primary_key(name, type = :primary_key, **options) ⇒ Object
Appends a primary key definition to the table definition.
Instance Method Details
#primary_key(name, type = :primary_key, **options) ⇒ Object
Appends a primary key definition to the table definition. Can be called multiple times, but this is probably not a good idea.
241 242 243 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 241 def primary_key(name, type = :primary_key, **) column(name, type, **.merge(primary_key: true)) end |