I currently am working on a project that involves storing data in an HTML5 SQL-Lite Database. Currently, I have a schema as follows (4 Tables):
TransData:
-----------------------------------------------------------
| TID | UserName | TransColor | ... | Date | Note |
-----------------------------------------------------------
| 6 | Brendan | Red | ... | | |
-----------------------------------------------------------
| 7 | Brendan | Red | ... | | 1 |
-----------------------------------------------------------
FullData:
-----------------------------------------------------------
| TID | UserName | TransColor | ... | Date | Note |
-----------------------------------------------------------
| 1 | Brendan | Red | ... | | Start |
-----------------------------------------------------------
| ... | Brendan | Red | ... | | |
-----------------------------------------------------------
| 40 | Brendan | Red | ... | | End |
-----------------------------------------------------------
SalamanderData:
----------------------------------------------------
| SID | SalamanderName | Length | ... | TID |
----------------------------------------------------
| 1 | Northern-Slimy | 16 | ... | 6 |
----------------------------------------------------
| 2 | Two-Lined | 26 | ... | 6 |
----------------------------------------------------
| 3 | Two-Lined | 12 | ... | 7 |
----------------------------------------------------
SalamanderData:
----------------------------------------------------
| SID | SalamanderName | Length | ... | TID |
----------------------------------------------------
| 1 | Northern-Slimy | 16 | ... | 6 |
----------------------------------------------------
| 2 | Two-Lined | 26 | ... | 6 |
----------------------------------------------------
| 3 | Two-Lined | 12 | ... | 7 |
----------------------------------------------------
Note: The "Note" column in TransData is used to point to the beginning data point of a collection in the FullData field.
The database between my App and the server SHOULD NOT BE IN SYNC. I am merely trying to dump all of these tables into the database on the server (and by dump I mean, update the references to other tables, and then insert into the server database).
I was going to use MAX(TID-Server) + TID-App = new TID-Server
, and cascade the updates down the tables.
How would you go about doing this?