Examples

Short-hand examples

Instead of calling column directly, you can
also work with the short-hand definitions for the default types. They use
the type as the method name instead of as a parameter and allow for
multiple columns to be defined in a single statement.

There's a short-hand method for each of the type values declared at the
top. And then there's #timestamps that'll
add created_at and updated_at as datetimes.

#references will add
an appropriately-named _id column, plus a corresponding _type column if the
:polymorphic option is supplied. If :polymorphic
is a hash of options, these will be used when creating the
_type column. The :index option will also create
an index, similar to calling add_index. So what can
be written like this: