20170119214911_create_preview_cards.rb 425 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. class CreatePreviewCards < ActiveRecord::Migration[5.0]
  3. def change
  4. create_table :preview_cards do |t|
  5. t.integer :status_id
  6. t.string :url, null: false, default: ''
  7. # OpenGraph
  8. t.string :title, null: true
  9. t.string :description, null: true
  10. t.attachment :image
  11. t.timestamps
  12. end
  13. add_index :preview_cards, :status_id, unique: true
  14. end
  15. end