Skip to content

Instantly share code, notes, and snippets.

@domagude
Last active October 20, 2017 12:12
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 domagude/38a8b2bb6590218773ed95f40ce8d736 to your computer and use it in GitHub Desktop.
Save domagude/38a8b2bb6590218773ed95f40ce8d736 to your computer and use it in GitHub Desktop.
class CreatePosts < ActiveRecord::Migration[5.1]
def change
create_table :posts do |t|
t.string :title
t.text :content
t.belongs_to :category, index: true
t.belongs_to :user, index: true
t.timestamps
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment