alter table jin_merchant_settings add email_log_enabled int(1) not null default 0;

create table jin_user_email_log
(
  id                  int(11) not null primary key,

  user_id             int(11) not null default 0,

  tstamp              datetime null,
  method              varchar(20) not null default '',

  from_string         varchar(255) not null default '',
  
  subject             varchar(255) not null default '',
  message             text not null default '',
  attachments         text not null default '',

  attr                varchar(255) not null default '',
  
  key(user_id)
);

##

drop index pgtxn_id on jin_paylog;
create index order_id on jin_paylog(order_id);
create index sale_id on jin_paylog(sale_id);
