class CreateMailHistories < ActiveRecord::Migration
  def change
    create_table :mail_histories do |t|
      t.string :email
      t.string :element_type
      t.integer :element_id
      t.text :body
      t.text :content
      t.string :subject
      t.text :content_cache
      t.string :subject_cache
      t.references :p_customer
      t.references :mail_content
      t.references :mail_type
      t.datetime :sended_at
      t.boolean :sended, :default => false
      t.references :lang_site
      
      t.timestamps null: false
    end
  end
end
