20210104114641_create_live_broads.rb 802 B

123456789101112131415161718192021222324252627282930313233
  1. # encoding:utf-8
  2. class CreateLiveBroads < ActiveRecord::Migration
  3. def up
  4. #直播间管理
  5. create_table :live_broads do |t|
  6. # 直播标题
  7. t.column :title, :string,:limit => 128, :null=>false
  8. #封面
  9. t.column :cover, :string,:limit => 256
  10. #房间号
  11. t.column :room_id, :integer,:null=>false, :default => 0
  12. #开始时间
  13. t.column :begin_time,:datetime
  14. #结束时间
  15. t.column :end_time,:datetime
  16. # 置顶
  17. t.column :show, :boolean, :default=>false
  18. # 备注
  19. t.column :remark, :string,:limit => 256
  20. t.timestamps
  21. end
  22. add_index :live_broads, :room_id
  23. add_column :products, :live, :boolean, :default=>false
  24. end
  25. def down
  26. drop_table :live_broads
  27. remove_column :products, :live
  28. end
  29. end