Add gid to libraries table