Module: ActiveRecord::ConnectionAdapters::ColumnMethods

Extended by:
ActiveSupport::Concern
Included in:
Table, TableDefinition
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/schema_definitions.rb

Instance Method Summary collapse

Methods included from ActiveSupport::Concern

append_features, class_methods, extended, included, prepend_features, prepended

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.



245
246
247
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 245

def primary_key(name, type = :primary_key, **options)
  column(name, type, **options.merge(primary_key: true))
end