drop sequence permission_id_seq cascade;
drop sequence permission_id_seq1 cascade;
drop table permission_old;
create sequence permission_id_seq; 
select setval('permission_id_seq', (select max(id)+1000 from permission) );
alter table permission alter column id set default nextval('permission_id_seq');
update permission set id = nextval('permission_id_seq') where id in (select id from permission group by id having count(*) > 1);
create unique index permission_id on permission(id);
