unique keys for query and group tags

Should probably have foreign keys too