20180407105907_create_news_posts.rb 289 B

123456789101112
  1. class CreateNewsPosts < ActiveRecord::Migration[5.1]
  2. def change
  3. create_table :news_posts do |t|
  4. t.string :name
  5. t.text :content
  6. t.belongs_to :user, foreign_key: true
  7. t.references :news_feed, index: true, polymorphic: true
  8. t.timestamps
  9. end
  10. end
  11. end