create sequence product_seq;
select setval('product_seq', (select max(id)+1 from product));
create sequence product_version_seq;
select setval('product_version_seq', (select max(id)+1 from product_version));
create sequence productlockseq;
select setval('productlockseq', (select max(id)+1 from productlock));
create sequence terms_and_conditions_seq;
select setval('terms_and_conditions_seq', (select max(id)+1 from terms_and_conditions));
create sequence users_seq;
select setval('users_seq', (select max(id)+1 from users));
create sequence configuration_seq;
select setval('configuration_seq', (select max(id)+1 from configuration));

alter sequence product_seq owner to downloader;
alter sequence product_version_seq owner to downloader;
alter sequence productlockseq owner to downloader;
alter sequence terms_and_conditions_seq owner to downloader;
alter sequence users_seq owner to downloader;
alter sequence configuration_seq owner to downloader;