timestamps

timestamps(*args) Instance Public methods Appends :datetime columns :created_at and :updated_at to the table.

remove_column

remove_column(name) Instance Public methods

references

references(*args) Instance Public methods Also aliased as: belongs_to

primary_key

primary_key(name, type = :primary_key, options = {}) Instance Public methods Appends a primary key definition to the table definition. Can be called multiple times, but this is probably not a good idea.

index

index(column_name, options = {}) Instance Public methods Adds index options to the indexes hash, keyed by column name This is primarily used to track indexes that need to be created after the table index(:account_id, name: 'index_projects_on_account_id')

columns

columns() Instance Public methods

column

column(name, type, options = {}) Instance Public methods Instantiates a new column for the table. The type parameter is normally one of the migrations native types, which is one of the following: :primary_key, :string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean. You may use a type not in this list as long as it is supported by your database (for example, âpolygonâ in MySQL), but this will not be database agnostic and should usually be

belongs_to

belongs_to(*args) Instance Public methods Alias for: references

[]

[](name) Instance Public methods Returns a ColumnDefinition for the column with name name.

new

new(types, name, temporary, options, as = nil) Class Public methods