|
| 1 | +UPDATE cross_entity SET planned_cross_id = null WHERE id = 'cross3'; |
| 2 | +DELETE FROM cross_entity_external_references where cross_entity_id = 'cross4'; |
| 3 | +DELETE FROM external_reference where id = 'cross_er_4'; |
| 4 | +DELETE FROM cross_parent where cross_id = 'cross4'; |
| 5 | +DELETE FROM cross_pollination_event where cross_id = 'cross4'; |
| 6 | +DELETE FROM cross_entity where id = 'cross4'; |
| 7 | + |
| 8 | +UPDATE seed_lot_content_mixture SET cross_id = null where id = 'seed_lot_content_mixture3'; |
| 9 | +DELETE FROM cross_entity_external_references where cross_entity_id = 'cross3'; |
| 10 | +DELETE FROM external_reference where id = 'cross_er_3'; |
| 11 | +DELETE FROM cross_parent where cross_id = 'cross3'; |
| 12 | +DELETE FROM cross_pollination_event where cross_id = 'cross3'; |
| 13 | +DELETE FROM cross_entity_cross_attributes where cross_entity_id = 'cross3'; |
| 14 | +DELETE FROM cross_entity where id = 'cross3'; |
| 15 | + |
| 16 | +DELETE FROM crossing_project_external_references where crossing_project_entity_id = 'crossing_project2'; |
| 17 | +DELETE FROM external_reference where id = 'crossing_project_er_2'; |
| 18 | +DELETE FROM crossing_project where id = 'crossing_project2'; |
| 19 | + |
| 20 | +UPDATE observation_unit SET cross_id = null where id = 'observation_unit3'; |
| 21 | +UPDATE cross_entity SET planned_cross_id = null WHERE id = 'cross1'; |
| 22 | +DELETE FROM cross_entity_external_references where cross_entity_id = 'cross2'; |
| 23 | +DELETE FROM external_reference where id = 'cross_er_2'; |
| 24 | +DELETE FROM cross_parent where cross_id = 'cross2'; |
| 25 | +DELETE FROM cross_pollination_event where cross_id = 'cross2'; |
| 26 | +DELETE FROM cross_entity where id = 'cross2'; |
| 27 | + |
| 28 | +UPDATE observation_unit SET cross_id = null where id IN ('observation_unit2', 'observation_unit1'); |
| 29 | +UPDATE seed_lot_content_mixture SET cross_id = null where id in ('seed_lot_content_mixture1', 'seed_lot_content_mixture2'); |
| 30 | +DELETE FROM cross_entity_external_references where cross_entity_id = 'cross1'; |
| 31 | +DELETE FROM external_reference where id = 'cross_er_1'; |
| 32 | +DELETE FROM cross_parent where cross_id = 'cross1'; |
| 33 | +DELETE FROM cross_pollination_event where cross_id = 'cross1'; |
| 34 | +DELETE FROM cross_entity_cross_attributes where cross_entity_id = 'cross1'; |
| 35 | +DELETE FROM cross_entity where id = 'cross1'; |
| 36 | + |
| 37 | +DELETE FROM crossing_project_external_references where crossing_project_entity_id = 'crossing_project1'; |
| 38 | +DELETE FROM external_reference where id = 'crossing_project_er_1'; |
| 39 | +DELETE FROM crossing_project where id = 'crossing_project1'; |
| 40 | + |
| 41 | +-- crossing project 1 |
| 42 | +INSERT INTO crossing_project (auth_user_id, id, description, "name", program_id) VALUES('anonymousUser', 'crossing_project1', 'This is a crossing project', 'Crossing Project', 'program1'); |
| 43 | +INSERT INTO external_reference(id, external_reference_id, external_reference_source) VALUES ('crossing_project_er_1', 'https://brapi.org/specification', 'BrAPI Doc'); |
| 44 | +INSERT INTO crossing_project_external_references(crossing_project_entity_id, external_references_id) VALUES ('crossing_project1', 'crossing_project_er_1'); |
| 45 | + |
| 46 | +INSERT INTO cross_entity (auth_user_id, id, cross_type, "name", planned, crossing_project_id) VALUES('anonymousUser', 'cross1', 0, 'germ1 X germ2', false, 'crossing_project1'); |
| 47 | +INSERT INTO cross_entity_cross_attributes (cross_entity_id, cross_attributes) VALUES('cross1', 'maleFloweringDate:2020-04-01'); |
| 48 | +insert into cross_pollination_event (id, pollination_number, pollination_successful, pollination_time_stamp, cross_id) values ('cross_pollination_event1', 'PN123', true, '2020-04-08', 'cross1'); |
| 49 | +INSERT INTO cross_parent (id, parent_type, cross_id, crossing_project_id, germplasm_id, observation_unit_id) VALUES('cross_parent1', 0, 'cross1', 'crossing_project1', 'germplasm1', 'observation_unit1'); |
| 50 | +INSERT INTO cross_parent (id, parent_type, cross_id, crossing_project_id, germplasm_id, observation_unit_id) VALUES('cross_parent2', 1, 'cross1', 'crossing_project1', 'germplasm2', 'observation_unit2'); |
| 51 | +INSERT INTO external_reference(id, external_reference_id, external_reference_source) VALUES ('cross_er_1', 'https://brapi.org/specification', 'BrAPI Doc'); |
| 52 | +INSERT INTO cross_entity_external_references(cross_entity_id, external_references_id) VALUES ('cross1', 'cross_er_1'); |
| 53 | +UPDATE seed_lot_content_mixture SET cross_id = 'cross1' where id = 'seed_lot_content_mixture1'; |
| 54 | +UPDATE seed_lot_content_mixture SET cross_id = 'cross1' where id = 'seed_lot_content_mixture2'; |
| 55 | +UPDATE observation_unit SET cross_id = 'cross1' where id = 'observation_unit1'; |
| 56 | +UPDATE observation_unit SET cross_id = 'cross1' where id = 'observation_unit2'; |
| 57 | + |
| 58 | +INSERT INTO cross_entity (auth_user_id, id, cross_type, "name", planned, crossing_project_id, status) VALUES('anonymousUser', 'cross2', 0, 'germ2 X germ3', true, 'crossing_project1', 1); |
| 59 | +insert into cross_pollination_event (id, pollination_number, pollination_successful, pollination_time_stamp, cross_id) values ('cross_pollination_event2', 'PN234', true, '2020-05-09', 'cross2'); |
| 60 | +insert into cross_pollination_event (id, pollination_number, pollination_successful, pollination_time_stamp, cross_id) values ('cross_pollination_event4', 'PN456', false, '2020-04-09', 'cross2'); |
| 61 | +INSERT INTO cross_parent (id, parent_type, cross_id, crossing_project_id, germplasm_id, observation_unit_id) VALUES('cross_parent3', 0, 'cross2', 'crossing_project1', 'germplasm3', 'observation_unit3'); |
| 62 | +INSERT INTO cross_parent (id, parent_type, cross_id, crossing_project_id, germplasm_id, observation_unit_id) VALUES('cross_parent4', 1, 'cross2', 'crossing_project1', 'germplasm2', 'observation_unit2'); |
| 63 | +INSERT INTO external_reference(id, external_reference_id, external_reference_source) VALUES ('cross_er_2', 'https://brapi.org/specification', 'BrAPI Doc'); |
| 64 | +INSERT INTO cross_entity_external_references(cross_entity_id, external_references_id) VALUES ('cross2', 'cross_er_2'); |
| 65 | +UPDATE cross_entity SET planned_cross_id = 'cross2' WHERE id = 'cross1'; |
| 66 | +UPDATE observation_unit SET cross_id = 'cross2' where id = 'observation_unit3'; |
| 67 | + |
| 68 | + |
| 69 | +-- crossing project 2 |
| 70 | +INSERT INTO crossing_project (auth_user_id, id, description, "name", program_id) VALUES('anonymousUser', 'crossing_project2', 'This is a crossing project', 'Crossing Project', 'program2'); |
| 71 | +INSERT INTO external_reference(id, external_reference_id, external_reference_source) VALUES ('crossing_project_er_2', 'https://brapi.org/specification', 'BrAPI Doc'); |
| 72 | +INSERT INTO crossing_project_external_references(crossing_project_entity_id, external_references_id) VALUES ('crossing_project2', 'crossing_project_er_2'); |
| 73 | + |
| 74 | +INSERT INTO cross_entity (auth_user_id, id, cross_type, "name", planned, crossing_project_id) VALUES('anonymousUser', 'cross3', 0, 'germ1 X germ2', false, 'crossing_project2'); |
| 75 | +INSERT INTO cross_entity_cross_attributes (cross_entity_id, cross_attributes) VALUES('cross3', 'maleFloweringDate:2020-04-03'); |
| 76 | +insert into cross_pollination_event (id, pollination_number, pollination_successful, pollination_time_stamp, cross_id) values ('cross_pollination_event3', 'PN345', true, '2020-04-08', 'cross3'); |
| 77 | +INSERT INTO cross_parent (id, parent_type, cross_id, crossing_project_id, germplasm_id, observation_unit_id) VALUES('cross_parent5', 0, 'cross3', 'crossing_project2', 'germplasm1', 'observation_unit1'); |
| 78 | +INSERT INTO cross_parent (id, parent_type, cross_id, crossing_project_id, germplasm_id, observation_unit_id) VALUES('cross_parent6', 1, 'cross3', 'crossing_project2', 'germplasm2', 'observation_unit2'); |
| 79 | +INSERT INTO external_reference(id, external_reference_id, external_reference_source) VALUES ('cross_er_3', 'https://brapi.org/specification', 'BrAPI Doc'); |
| 80 | +INSERT INTO cross_entity_external_references(cross_entity_id, external_references_id) VALUES ('cross3', 'cross_er_3'); |
| 81 | +UPDATE seed_lot_content_mixture SET cross_id = 'cross3' where id = 'seed_lot_content_mixture3'; |
| 82 | + |
| 83 | +INSERT INTO cross_entity (auth_user_id, id, cross_type, "name", planned, crossing_project_id, status) VALUES('anonymousUser', 'cross4', 0, 'germ2 X germ3', true, 'crossing_project2', 0); |
| 84 | +insert into cross_pollination_event (id, pollination_number, pollination_successful, pollination_time_stamp, cross_id) values ('cross_pollination_event5', 'PN567', true, '2020-05-09', 'cross4'); |
| 85 | +insert into cross_pollination_event (id, pollination_number, pollination_successful, pollination_time_stamp, cross_id) values ('cross_pollination_event6', 'PN678', false, '2020-04-09', 'cross4'); |
| 86 | +INSERT INTO cross_parent (id, parent_type, cross_id, crossing_project_id, germplasm_id, observation_unit_id) VALUES('cross_parent7', 0, 'cross4', 'crossing_project2', 'germplasm3', 'observation_unit3'); |
| 87 | +INSERT INTO cross_parent (id, parent_type, cross_id, crossing_project_id, germplasm_id, observation_unit_id) VALUES('cross_parent8', 1, 'cross4', 'crossing_project2', 'germplasm2', 'observation_unit2'); |
| 88 | +INSERT INTO external_reference(id, external_reference_id, external_reference_source) VALUES ('cross_er_4', 'https://brapi.org/specification', 'BrAPI Doc'); |
| 89 | +INSERT INTO cross_entity_external_references(cross_entity_id, external_references_id) VALUES ('cross4', 'cross_er_4'); |
| 90 | +UPDATE cross_entity SET planned_cross_id = 'cross4' WHERE id = 'cross3'; |
| 91 | + |
0 commit comments