use island42;
drop table if exists mail_log;

create table mail_log (
  id int(11) NOT NULL primary key auto_increment,
  sent timestamp NOT NULL default now(),
  from_user_id int(11) NOT NULL,
  to_user_id int(11) NOT NULL,
  session_user_id int(11) NOT NULL default '0',
  template_name varchar(25) NOT NULL default '',
  subject varchar(255) NOT NULL default '',
  text_body text NOT NULL default '',
  html_body text NOT NULL default '',
  received timestamp NOT NULL default '0'
) type=InnoDB;

create index mail_log_i1 on mail_log(from_user_id);
create index mail_log_i2 on mail_log(to_user_id);
create index mail_log_i3 on mail_log(sent);
create index mail_log_i4 on mail_log(received);
create index mail_log_i5 on mail_log(template_name);