Skip to content

Instantly share code, notes, and snippets.

@Tasha25
Last active December 29, 2015 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tasha25/7586228 to your computer and use it in GitHub Desktop.
Save Tasha25/7586228 to your computer and use it in GitHub Desktop.
Active record when you have to add a column
rails generate migration AddIqToZombie iq:integer
You have to tell the ActiveRecord what they are doing Add
You have to tell them to what column to add Iq
You have to tell them to what table Zombie
You have to tell them the type of material that it will be, in this case iq will be an integer
Then do rake db:migrate and/or RAILS_ENV=test rake db:migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment