class CreateMailHists < ActiveRecord::Migration[6.0]
  def change
    create_table :mail_hists do |t|
      
      t.references :lang_site
      t.string :from_email
     
      t.string :to_email

      t.string :subject

      t.text :body
      
      t.string :subject_send
      
      t.text :body_send
     
      
      t.references :mail_content, foreign_key: true
      t.references :mail_type, foreign_key: true
      t.string :element_type
      t.integer :element_id
      t.references :m_odr_rep, foreign_key: true
      t.references :m_odr, foreign_key: true
      t.boolean :mj_read
      t.string :mj_token
      
      t.integer :nbr_send

      t.timestamps
    end
  end
end
