SELECT SETVAL('permissions_id_seq', (SELECT MAX(id) FROM permissions)); SELECT SETVAL('menu_roles_id_seq', (SELECT MAX(id) FROM menu_roles));