create table jin_metaaff
(
  id            int(11) not null primary key,
  owner_id      int(11) not null,
  
  title         varchar(255) not null default '',
  
  aff_selected  varchar(255) not null default '',
  aff_group     varchar(255) not null default '',
  
  key(owner_id)
);

alter table jin_role add priv_master_plugins_metaaffs int(1) not null default 0 after priv_master_plugins_helptickets;

alter table jin_sale add metaaff_id int(11) not null default 0 after aff_camp_id;


alter table jin_tax add embedded int(1) not null default 0 after percent;
alter table jin_sale add amount_tax_embed int(1) not null default 0 after amount_tax_pc;
alter table jin_sale add amount_tax varchar(50) not null default '' after amount_tax_embed;
alter table jin_sale add amount_comms varchar(50) not null default '' after amount_shipping;

alter table jin_product add pointscomm_aff int(1) not null default 0 after points_price;
alter table jin_product add pointscomm_jvpartner int(1) not null default 0 after pointscomm_aff;

alter table jin_ext_script add resprog_base_obj_id int(11) not null after owner_id;

