Sync Scripts

(Dev Manual)


The Script folder Sync contains all of the scripts for syncing. These scripts are numbers x_1 through 1_6 and each set of scripts (from 0-13 sync one table in the database.


The 1_1 Import Audit Trail is slightly different than the others. It doesn’t compare anything between the child database and the parent database. It merely imports the new child records into the parent database.


The x_1-x_6 scripts are all the same except for the tables they reference.


2_1 Import New Trenches

imports all child records into the parent shadow records. It first checks to see if there are any records left in the shadow database and removes them if necessary.


2_2 Import New Records from Child

Finds the records that were newly created in the child database and imports them into the parent trenches table. It has to check to see if there was a last sync. If not, the script knows what to do but you might have more records to reconcile in the 2_4 step.


2_3 Find Trenches edited on child and not parent

Finds old records that are newly edited on the child database. Once found, it imports the records, but matches the TrenchName field and replaces all other data with the data on the child record. If there is nothing in the LastSyncTimestamp field, then the database will ask you to reconcile all edited records.


2_4 Find trenches edited on both parent and child

Finds records edited in both databases. If it finds any it asks you to reconcile the records, and takes you to a layout to do so. Records that are different are highlighted in yellow. Make sure that the records on the right are the correct versions. It is vital that you click the Resolved button to continue onto the next step so the scripts work again next time.


2_5 Fix last import time stamp

To keep the syncing working properly, this script must run. If not, things will still work, but you will have to reconcile many more records.


2_6 Remove Shadow Trench Data

This removes the temporary shadow data and gets the script ready for the next sync.



<-Why so many media tables? UUID Field->