<commit_before>-- UPDATE THE STAMPEDE DATABASE TO ADD CASCADED DELETES
-- TO BE RUN ONLY BY AN ADMIN on existing V4.0 Stampede SCHEMA DB in MYSQL
-- Example invocation is mysql -u username -p -h hostname databasename < upgrade_stampede_4.0.sql
 
--
-- Table structure for table `file`
--

ALTER TABLE `file` DROP FOREIGN KEY `file_ibfk_1`;
ALTER TABLE `file` ADD CONSTRAINT `file_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `task` (`task_id`) ON DELETE CASCADE;

--
-- Table structure for table `host`
-- 

ALTER TABLE `host` DROP FOREIGN KEY `host_ibfk_1`;
ALTER TABLE `host` ADD CONSTRAINT `host_ibfk_1` FOREIGN KEY (`wf_id`) REFERENCES `workflow` (`wf_id`) ON DELETE CASCADE;

--
-- Table structure for table `invocation`
-- 

ALTER TABLE `invocation` DROP FOREIGN KEY `invocation_ibfk_1`, DROP FOREIGN KEY `invocation_ibfk_2`;
ALTER TABLE `invocation` ADD CONSTRAINT `invocation_ibfk_1` FOREIGN KEY (`job_instance_id`) REFERENCES `job_instance` (`job_instance_id`) ON DELETE CASCADE, ADD CONSTRAINT `invocation_ibfk_2` FOREIGN KEY (`wf_id`) REFERENCES `workflow` (`wf_id`) ON DELETE CASCADE;
 
--
-- Table structure for table `job`
-- <commit_msg>Breaking up drops and adds into individual lines. May need fixing to check if key exist only then delete<commit_after>-- UPDATE THE STAMPEDE DATABASE TO ADD CASCADED DELETES
-- TO BE RUN ONLY BY AN ADMIN on existing V4.0 Stampede SCHEMA DB in MYSQL
-- Example invocation is mysql -u username -p -h hostname databasename < upgrade_stampede_4.0.sql
 
--
-- Table structure for table `file`
--

ALTER TABLE `file` DROP FOREIGN KEY `file_ibfk_1`;
ALTER TABLE `file` ADD CONSTRAINT `file_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `task` (`task_id`) ON DELETE CASCADE;

--
-- Table structure for table `host`
-- 

ALTER TABLE `host` DROP FOREIGN KEY `host_ibfk_1`;
ALTER TABLE `host` ADD CONSTRAINT `host_ibfk_1` FOREIGN KEY (`wf_id`) REFERENCES `workflow` (`wf_id`) ON DELETE CASCADE;

--
-- Table structure for table `invocation`
-- 

ALTER TABLE `invocation` DROP FOREIGN KEY `invocation_ibfk_1`;
ALTER TABLE `invocation` DROP FOREIGN KEY `invocation_ibfk_2`;
ALTER TABLE `invocation` ADD CONSTRAINT `invocation_ibfk_1` FOREIGN KEY (`job_instance_id`) REFERENCES `job_instance` (`job_instance_id`) ON DELETE CASCADE;
ALTER TABLE `invocation` ADD CONSTRAINT `invocation_ibfk_2` FOREIGN KEY (`wf_id`) REFERENCES `workflow` (`wf_id`) ON DELETE CASCADE;
 
--
-- Table structure for table `job`
-- 
{'fraction_non_alphanumeric': 0.10364604670217124, 'fraction_numerical': 0.009832036050798854, 'mean_word_length': 4.759433962264151, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6633524', 'n_tokens_mistral': 955, 'n_tokens_neox': 894, 'n_words': 298}