Skip to content
Snippets Groups Projects
Commit a5934e0c authored by izabel's avatar izabel
Browse files

[LMS-1701] remove of redundant channel stacks

SVN: 17519
parent 9f93d632
No related branches found
No related tags found
No related merge requests found
-- Migration from 005 to 006 -- Migration from 005 to 006
-- Remove references to redundant channel stacks
update acquired_images set channel_stack_id = mapping.new from (select cs.id as old, ucs.max_id as new from (select max(id) as max_id,x,y,spot_id,ds_id from channel_stacks group by x,y,spot_id,ds_id) as ucs, channel_stacks cs where cs.x = ucs.x and cs.y = ucs.y and cs.spot_id = ucs.spot_id and cs.ds_id = ucs.ds_id and not cs.id = ucs.max_id) as mapping where mapping.old = channel_stack_id;
-- Remove redundant channel stacks
delete from channel_stacks where id not in (select max(id) as max_id from channel_stacks group by x,y,spot_id,ds_id);
ALTER TABLE CHANNELS ADD COLUMN CODE NAME; ALTER TABLE CHANNELS ADD COLUMN CODE NAME;
ALTER TABLE CHANNELS DROP CONSTRAINT CHANNELS_UK_1; ALTER TABLE CHANNELS DROP CONSTRAINT CHANNELS_UK_1;
ALTER TABLE CHANNELS DROP CONSTRAINT CHANNELS_UK_2; ALTER TABLE CHANNELS DROP CONSTRAINT CHANNELS_UK_2;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment