update jin_merchant_settings set autoassign_roles=3 where autoassign_roles='';


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

  title               varchar(255) not null default '',
  apikey              varchar(255) not null default '',
  
  apicalls            varchar(255) not null default '',
  specusers           int(11) not null default 0
);

alter table jin_role add priv_auth_profile_apicenter int(1) not null default 0 after priv_auth_profile_merchant;

insert into jin_api_gate select id,title,secret,'authorize,listusers,getuser,getusermembership,setusermembership,adduser,updateuser',specusers from jin_api_user;

alter table jin_specusers add type varchar(50) not null after id;
update jin_specusers set type='local';
alter table jin_specusers add remote_delavo_api_url varchar(255) not null default '';

alter table jin_helpticket_category add specusers_ids varchar(255) not null default '' after membership_ids;

alter table jin_helpticket_category change membership_error access_error text not null default '';

alter table jin_merchant_settings add force_https int(1) not null default 0 after aff_prevailing_mode;

alter table jin_external_ipn add ip varchar(32) not null default '' after pgate_title;
