Moving Images between groups via sql
Posted: Wed Oct 12, 2011 5:54 am
I am trying to move an image between two groups in the same user in OMERO (I have one group set as private and the other as collaborative Read Only).
I have identified these following sql calls that need to be made (assuming you have the group ids and permission ids that the image id needs to be moved to) but I think I've missed something. The first time I did this it worked, but when I tried this a second time with a new image it didn't work. I am making these calls from the postgresql backend. Could you suggest what I am forgetting? I wasn't sure if the id in logicalchannel corresponded to an image or something else.
UPDATE annotation SET permissions=-103 WHERE id=51;
UPDATE annotation SET group_id=153 WHERE id=51;
UPDATE channel SET permissions=-103 WHERE id=51;
UPDATE channel SET group_id=153 WHERE id=51;
UPDATE channelbinding SET permissions=-103 WHERE id=51;
UPDATE channelbinding SET group_id=153 WHERE id=51;
UPDATE datasetimagelink SET permissions=-103 WHERE child=51;
UPDATE datasetimagelink SET group_id=153 WHERE child=51;
UPDATE image SET permissions=-103 WHERE id=51;
UPDATE image SET group_id=153 WHERE id=51;
UPDATE imageannotationlink SET permissions=-103 WHERE id=51;
UPDATE imageannotationlink SET group_id=153 WHERE id=51;
UPDATE pixels SET permissions=-103 WHERE id=51;
UPDATE pixels SET group_id=153 WHERE id=51;
UPDATE planeinfo SET permissions=-103 WHERE id=51;
UPDATE planeinfo SET group_id=153 WHERE id=51;
UPDATE quantumdef SET permissions=-103 WHERE id=51;
UPDATE quantumdef SET group_id=153 WHERE id=51;
UPDATE renderingdef SET permissions=-103 WHERE id=51;
UPDATE renderingdef SET group_id=153 WHERE id=51;
UPDATE statsinfo SET permissions=-103 WHERE id=51;
UPDATE statsinfo SET group_id=153 WHERE id=51;
UPDATE thumbnail SET permissions=-103 WHERE id=51;
UPDATE thumbnail SET group_id=153 WHERE id=51;
I have identified these following sql calls that need to be made (assuming you have the group ids and permission ids that the image id needs to be moved to) but I think I've missed something. The first time I did this it worked, but when I tried this a second time with a new image it didn't work. I am making these calls from the postgresql backend. Could you suggest what I am forgetting? I wasn't sure if the id in logicalchannel corresponded to an image or something else.
UPDATE annotation SET permissions=-103 WHERE id=51;
UPDATE annotation SET group_id=153 WHERE id=51;
UPDATE channel SET permissions=-103 WHERE id=51;
UPDATE channel SET group_id=153 WHERE id=51;
UPDATE channelbinding SET permissions=-103 WHERE id=51;
UPDATE channelbinding SET group_id=153 WHERE id=51;
UPDATE datasetimagelink SET permissions=-103 WHERE child=51;
UPDATE datasetimagelink SET group_id=153 WHERE child=51;
UPDATE image SET permissions=-103 WHERE id=51;
UPDATE image SET group_id=153 WHERE id=51;
UPDATE imageannotationlink SET permissions=-103 WHERE id=51;
UPDATE imageannotationlink SET group_id=153 WHERE id=51;
UPDATE pixels SET permissions=-103 WHERE id=51;
UPDATE pixels SET group_id=153 WHERE id=51;
UPDATE planeinfo SET permissions=-103 WHERE id=51;
UPDATE planeinfo SET group_id=153 WHERE id=51;
UPDATE quantumdef SET permissions=-103 WHERE id=51;
UPDATE quantumdef SET group_id=153 WHERE id=51;
UPDATE renderingdef SET permissions=-103 WHERE id=51;
UPDATE renderingdef SET group_id=153 WHERE id=51;
UPDATE statsinfo SET permissions=-103 WHERE id=51;
UPDATE statsinfo SET group_id=153 WHERE id=51;
UPDATE thumbnail SET permissions=-103 WHERE id=51;
UPDATE thumbnail SET group_id=153 WHERE id=51;