Skip to content

Instantly share code, notes, and snippets.

@lloydwatkin
Created September 8, 2012 12:55
Show Gist options
  • Save lloydwatkin/3674670 to your computer and use it in GitHub Desktop.
Save lloydwatkin/3674670 to your computer and use it in GitHub Desktop.
Owner fix
[lloyd@desktop buddycloud-server]$ psql -d buddycloud-server -c "update affiliations set \"user\" = 'memememme' where node = '/user/[email protected]/posts' and affiliation = 'owner';"UPDATE 1
[lloyd@desktop buddycloud-server]$ psql -d buddycloud-server -c "select * from affiliations where node IN (select node from node_config where key = 'channelType' and value = 'personal') and affiliation = 'owner';" node | user | affiliation | updated
------------------------------------------+------------------------------+-------------+---------
/user/[email protected]/posts | memememme | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
(13 rows)
[lloyd@desktop buddycloud-server]$ psql -d buddycloud-server -c "update affiliations set \"user\" = substring(node from '^/user/(.*)/.*$') where node IN (select node from node_config where key = 'channelType' and value = 'personal') and affiliation = 'owner';"
UPDATE 13
[lloyd@desktop buddycloud-server]$ psql -d buddycloud-server -c "select * from affiliations where node IN (select node from node_config where key = 'channelType' and value = 'personal') and affiliation = 'owner';" node | user | affiliation | updated
------------------------------------------+------------------------------+-------------+---------
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
/user/[email protected]/posts | [email protected] | owner |
(13 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment