20170310302539_create_key_word_pushs.rb 802 B

1234567891011121314151617181920212223242526272829303132
  1. # encoding:utf-8
  2. # 用户发送关键字,推送什么内容
  3. class CreateKeyWordPushs < ActiveRecord::Migration
  4. def self.up
  5. create_table :key_word_pushs do |t|
  6. #关键字
  7. t.column :key_word, :string
  8. #推送类型,image图片,text文字,article图文
  9. t.column :push_type, :string, :null => false
  10. #标题
  11. t.column :push_title, :string
  12. #图片
  13. t.column :cover, :string
  14. #文案
  15. t.column :word, :string
  16. #点击链接
  17. t.column :url, :string
  18. #备注
  19. t.column :remark, :string, :null => false
  20. #公众号ID
  21. t.column :wx_gongzhonghao_id, :integer
  22. t.timestamps
  23. end
  24. add_index :key_word_pushs, :key_word
  25. end
  26. def self.down
  27. drop_table :key_word_pushs
  28. end
  29. end