Open dshao opened 10 months ago
update sequence_run set status = 'ARCHIVE' where status = 'COMPLETED'; update sequence_alignment set is_preferred = false;
We need to keep the old analysis and sequence_alignment first if we want to keep the results: analysis: Downstream Analysis, including Peak Statistics and MEME Motifs. sequence_alignment: Mapping Statistics.
We can first set sequence_alignment's is_preferred to false;
After the new analysis is completed, we can delete the old analysis, sequence_alignment and summary_report based on sequence_alignment's is_preferred
delete from analysis where alignment_id in (select id from sequence_alignment where is_preferred = false); delete from report_alignments; delete from sequence_alignment where is_preferred = false; update sequencing_cohort set report_id = NULL; delete from summary_report;