/*
 * Date:          2011-01-20
 * Author:        Andrei Perciun
 * Description:   Sript assigns blog entries imported from wordpress to behrmanhouse domain
                  Initialy all nodes are visible to all domains and script first
                  deletes "visibility" and then assigns nodes only to one domain.
*/
# Delete rows which grants access for all domains
DELETE FROM domain_access WHERE nid IN (SELECT nid FROM node WHERE type = 'blog');

# Add entries which grants access only for berhmanhouse
INSERT INTO domain_access (nid, gid, realm)
SELECT nid, 0, 'domain_id'
FROM node
WHERE type = 'blog';