20180810062245_create_wx_menus.rb 856 B

12345678910111213141516171819202122232425262728293031323334
  1. class CreateWxMenus < ActiveRecord::Migration
  2. def self.up
  3. create_table :wx_menus do |t|
  4. #微信公众号
  5. t.integer :wx_gongzhonghao_id, :null => false
  6. # 菜单名
  7. t.string :name
  8. # 上级
  9. t.string :ancestry, :limit => 64
  10. # 内容(小程序填写的是备用url)
  11. t.text "content"
  12. # 操作类型
  13. t.string "action", :limit => 15, :default => "view"
  14. # 创建时间
  15. t.datetime "created_at"
  16. # 事件关键字
  17. t.string "key"
  18. # 位置
  19. t.integer "position"
  20. # 小程序appid(小程序必填)
  21. t.string :appid
  22. # 小程序页面路径(小程序必填)
  23. t.string :pagepath
  24. end
  25. add_index :wx_menus, :wx_gongzhonghao_id
  26. add_index :wx_menus, :ancestry
  27. end
  28. def self.down
  29. drop_table :wx_menus
  30. end
  31. end