CC5418 Remove redundant show instance and scheduled item during upgrade
This commit is contained in:
parent
9ea686880e
commit
7341aa5815
|
@ -55,4 +55,14 @@ LANGUAGE plpgsql;
|
|||
SELECT migrateWebstreamHistory() as output;
|
||||
|
||||
DROP FUNCTION migrateWebstreamHistory();
|
||||
DROP VIEW ws_history;
|
||||
DROP VIEW ws_history;
|
||||
|
||||
DELETE from cc_show_instances AS ins
|
||||
WHERE (ins.starts,ins.ends,ins.show_id)
|
||||
IN (SELECT starts,ends,show_id FROM cc_show_instances GROUP BY starts,ends,show_id HAVING count(*) >1 )
|
||||
AND ins.id NOT IN (SELECT min(id) FROM cc_show_instances GROUP BY starts,ends,show_id HAVING count(*) >1 );
|
||||
|
||||
|
||||
DELETE FROM cc_schedule
|
||||
WHERE id
|
||||
IN (SELECT sc.id FROM cc_schedule AS sc LEFT JOIN cc_show_instances AS i ON sc.instance_id=i.id LEFT JOIN cc_show AS s ON i.show_id=s.id WHERE sc.starts<i.starts ORDER BY sc.starts);
|
||||
|
|
Loading…
Reference in New Issue