updated sql scripts and register seq funcs