Top "Rails-migrations" questions

Rails migrations are used to track and apply database alterations in a reversible manner.

Rails Migration: add_reference to Table but Different Column Name For Foreign Key Than Rails Convention

I have the following two Models: class Store < ActiveRecord::Base belongs_to :person end class Person < ActiveRecord::Base …

ruby-on-rails rails-migrations
What's the correct syntax for remove_index in a Rails 3.1.0 migration?

I'm in the process of adding Devise to an existing Rails app, with a Users table already defined. The devise …

ruby-on-rails ruby-on-rails-3.1 rails-migrations
Rails Migration with adding and removing reference

After creating a migration file with rails generate migration AddClientToUser I can edit my migration file like so: class AddClientToUser &…

ruby ruby-on-rails-3 rails-migrations
Rails migrations: Undo default setting for a column

I have the problem, that I have an migration in Rails that sets up a default setting for a column, …

ruby-on-rails rails-migrations
varchar Migration question for Ruby on Rails

I have created a new table including a column "note". The default is varchar(255) I believe but I wish to …

ruby-on-rails activerecord migration rails-migrations
Where is the documentation page for ActiveRecord data types?

I can't find the active record documenation page that has a list of all the data types. Can someone help …

ruby-on-rails rails-migrations
Rolling back a failed Rails migration

How do you roll back a failed rails migration? I would expect that rake db:rollback would undo the failed …

mysql ruby-on-rails rails-activerecord rails-migrations
Ruby on Rails: adding columns to existing database

I'm getting an error: SQLite3::SQLException: no such column: ideas.list_id: SELECT "ideas".* FROM "ideas" WHERE "ideas"."list_id" = 2 …

ruby-on-rails ruby ruby-on-rails-3 migration rails-migrations
how to set default value to column in rails while creating migration

I am new to Model in rails. I know how to create model & how to add column to them. …

ruby-on-rails-3 activerecord rails-migrations
How do you skip failed migrations? (rake db:migrate)

I can't seem to find an option or anything that allows me to skip migrations. I know what you're thinking: "…

ruby-on-rails rake rails-migrations