alter table jin_package add html_head text not null default '' after pgates;
update jin_package set html_head='<title>JVManager 2 Fantasos</title>\n<meta name="keywords" content=""/>\n<meta name="description" content=""/>' where html_head='';

alter table jin_sale add download_ctime datetime null after oto_shown;
update jin_sale set download_ctime=ctime where download_ctime is null;

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

  signature                   text not null default '',
  footermassmail              text not null default '',
  footerdownline              text not null default '',

  user_register               text not null default '',
  user_remindpasswd           text not null default '',
  user_changeemail            text not null default '',
  user_import                 text not null default '',
  user_logindata              text not null default '',

  approvals_affprog_due       text not null default '',
  approvals_affprog_approved  text not null default '',
  approvals_affprog_rejected  text not null default '',

  approvals_role_due          text not null default '',
  approvals_role_approved     text not null default '',
  approvals_role_rejected     text not null default '',

  sale_paidcustomer           text not null default '',
  sale_paidadmin              text not null default '',
  sale_paidowner              text not null default '',

  access_lmem                 text not null default '',
  access_rmem                 text not null default '',
  access_minisite             text not null default '',

  comm_created                text not null default '',
  comm_createdrecur           text not null default '',
  comm_referral               text not null default '',
  comm_refunded               text not null default '',
  comm_royalty_due            text not null default '',
  comm_royalty_overdue        text not null default '',
  comm_royalty_superoverdue   text not null default '',

  jventure_product_added      text not null default '',
  jventure_product_modified   text not null default '',
  jventure_product_reqmod     text not null default '',
  jventure_product_approved   text not null default '',

  coupon_cust                 text not null default '',
  coupon_aff                  text not null default '',

  key(owner_id)
);

alter table jin_role add priv_master_tools_emails int(1) not null default 0 after priv_master_tools_templates;

alter table jin_embedded_email add sale_echeckfailed text not null default '' after sale_paidowner;

alter table jin_package_product add upsell int(1) not null default 0 after pack_id;

alter table jin_affprog add comm100 int(1) not null default 0 after welcomem_ids;

delete from jin_template_place where tmpl_set_type='mail';
