20181206064848_create_share_material_tables.rb 849 B

12345678910111213141516171819202122232425262728
  1. class CreateShareMaterialTables < ActiveRecord::Migration
  2. def change
  3. create_table :share_materials do |t|
  4. t.column :wx_uid, :integer, :null=>false
  5. t.column :m_type, :string, :null=>false, :limit => 20, :default => 'project'
  6. t.column :type_id, :integer, :null=>false
  7. t.column :material_text, :text
  8. t.column :image_1st, :string
  9. t.column :image_2nd, :string
  10. t.column :image_3rd, :string
  11. t.column :image_4th, :string
  12. t.column :image_5th, :string
  13. t.column :image_6th, :string
  14. t.column :image_7th, :string
  15. t.column :image_8th, :string
  16. t.column :image_9th, :string
  17. t.boolean :is_published, :default => false
  18. t.timestamps
  19. end
  20. add_index :share_materials, :wx_uid
  21. end
  22. def down
  23. drop_table :share_materials
  24. end
  25. end