alter table jin_package_hit modify camp_id varchar(50) not null default '';
alter table jin_order modify aff_camp_id varchar(50) not null default '';
alter table jin_sale modify aff_camp_id varchar(50) not null default '';

alter table jin_role add priv_master_affiliates_campaigns varchar(50) not null default '' after priv_master_affiliates_affprogs;

drop index camp_id on jin_package_hit;
create index camp_id on jin_package_hit(camp_id,aff_user_id);
update jin_package_hit set camp_id='' where camp_id=0;

alter table jin_campaign drop enabled;

alter table jin_campaign add affprogs varchar(255) not null default '';
alter table jin_campaign add unify_pack_hits int(1) not null default 0;
alter table jin_campaign add unify_order_sales int(1) not null default 0;
alter table jin_campaign add count_only_packs varchar(255) not null default '';
alter table jin_campaign add count_only_prods varchar(255) not null default '';

alter table jin_short_url add ref_obj_type varchar(15) not null default '';
alter table jin_short_url add ref_obj_id int(11) not null default 0;
create index ref_obj_type on jin_short_url(ref_obj_type,ref_obj_id);

alter table jin_package add campaigns varchar(255) not null default '' after quickresell_affprogs;

update jin_package set no_aff_area=0 where type=5;
