
alter table jin_role add priv_master_customers_tracklinks varchar(50) not null default '' after priv_master_customers_shipdue;

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

  alias        varchar(70) not null default '',
  url          varchar(255) not null default '',

  admin_notes  text not null default '',

  clicks       int(11) not null default 0,
  uvisits      int(11) not null default 0
);

alter table jin_user add tracklink_id int(11) not null default 0 after admin_notes;
alter table jin_sale add tracklink_id int(11) not null default 0 after metaaff_id;
create index tracklink_id on jin_sale(tracklink_id,paid);

alter table jin_funnel_condition add set_type int(1) not null default 0 after step_id;
drop index step_id on jin_funnel_condition;
create index step_id on jin_funnel_condition(step_id,set_type);

alter table jin_user add lastlog_ip varchar(32) not null default '' after reg_ip;

alter table jin_sale add has_comms int(1) not null default 0 after amount_comms;
