Monday, January 30, 2006

Adding primary keys in Rails migrations

Module: ActiveRecord::ConnectionAdapters::SchemaStatements

The API doc on add_column() refers to column_types which say that it can be of type :primary_key. This is not true. add_column cannot use :primary_key as a type. Currently, I have no idea how to indicate that a field is a primary key and needs to be auto incremented.

You might have to drop the entire table and create it again.

No comments:

Post a Comment