Skip to content

Instantly share code, notes, and snippets.

@fabianvelizok
Created March 27, 2015 13:55
Show Gist options
  • Save fabianvelizok/f2845a3b7394465f9e05 to your computer and use it in GitHub Desktop.
Save fabianvelizok/f2845a3b7394465f9e05 to your computer and use it in GitHub Desktop.
class CreateTweets < ActiveRecord::Migration
def change
create_table :tweets do |t|
t.attachment :image
t.text :body
t.belongs_to :user, index: true
t.timestamps
end
add_foreign_key :tweets, :user
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment