Skip to content

Instantly share code, notes, and snippets.

@beverlynelson
Last active December 16, 2015 19:39
Show Gist options
  • Save beverlynelson/5486386 to your computer and use it in GitHub Desktop.
Save beverlynelson/5486386 to your computer and use it in GitHub Desktop.
class AddTitleToPosts < ActiveRecord::Migration
def change
add_column :posts, :title, :string
add_column :posts, :image, :string
add_column :posts, :link, :string
add_column :posts, :documentation, :text
end
#NOTE: there's another way to write ^ a little more streamlined
#For now do this for clarity
end
class CreatePosts < ActiveRecord::Migration
def change
create_table :posts do |t|
t.string :title
t.string :image
t.string :link
t.text :documentation
t.timestamps
end
end
end
@beverlynelson
Copy link
Author

So this is a base to work with. You can always add things later but that at least gets you started

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment