Add Collecting Trip to existing Collecting Events

In the first post I wrote that it would be easy to do it from SQL prompt. I put it down on paper in case it may help someone not fully confident with the process.

As always when attempting to work directly on SQL database, make a database backup beforehand. Quoting Grant Master :innocent: :

I first created the Collecting Trip “Mission Wallis et Futuna” from the Data Entry tab (I had to previously edit the Data Entry tab to include the Collecting Trip table, not visible by default)

  1. Retrieved the newly created collectingTripID
select CollectingTripID, Collectingtripname from collectingtrip;
+------------------+--------------------------+
| CollectingTripID | Collectingtripname       |
+------------------+--------------------------+
|              798 | Mission Wallis et Futuna |
+------------------+--------------------------+
  1. Selected specific collecting events

In our case we had indicated the collecting events were part of this trip with a note in text fied collectingevent:text2.

SELECT text1, integer1, startDate, collectingtripid FROM collectingevent WHERE text2 LIKE "%Mission Wallis et Futuna%";
+-----------+----------+------------+------------------+
| text1     | integer1 | startDate  | collectingtripid |
+-----------+----------+------------+------------------+
| CE-094791 |     5245 | 2008-11-11 |             NULL |
| CE-094796 |     5246 | 2008-11-11 |             NULL |
| CE-094964 |     5247 | 2008-11-11 |             NULL |
| CE-094781 |     5252 | 2008-11-11 |             NULL |
| CE-094780 |     5253 | 2008-11-11 |             NULL |
...
  1. Updated the field collectingevent:collectingtripid for those CEs
UPDATE collectingevent
SET collectingtripid = 798
WHERE text2 LIKE "%Mission Wallis et Futuna%";
  1. Validated the update from the query builder

I created a new query including Collecting Trip columns and confirmed that everything went smoothly.

Done :partying_face:

2 Likes