gallery db scripts