class CreateShareMaterialTables < ActiveRecord::Migration def change create_table :share_materials do |t| t.column :wx_uid, :integer, :null=>false t.column :m_type, :string, :null=>false, :limit => 20, :default => 'project' t.column :type_id, :integer, :null=>false t.column :material_text, :text t.column :image_1st, :string t.column :image_2nd, :string t.column :image_3rd, :string t.column :image_4th, :string t.column :image_5th, :string t.column :image_6th, :string t.column :image_7th, :string t.column :image_8th, :string t.column :image_9th, :string t.boolean :is_published, :default => false t.timestamps end add_index :share_materials, :wx_uid end def down drop_table :share_materials end end