anything
AirNav RadarBox
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 


Author Topic: which Database do we do changes in  (Read 3351 times)

0 Members and 1 Guest are viewing this topic.

steveb25

  • Guest
which Database do we do changes in
« on: March 12, 2008, 05:59:10 PM »
Hi All

I think I have now got my head around the two databases that store the info in ANRB.

My question is in relation to updates. I have got a copy of Sqlite expert to edit the files, but not sure as to which way to go.

Do both databases update each other. ie if I update the navdata.db3 will it make changes to myLog.db3 and vice-versa

Any help would be much appreciated.

steveb25

  • Guest
Re: which Database do we do changes in
« Reply #1 on: March 12, 2008, 07:24:35 PM »
Have just had a little play with the databases.
Findings so far.

It you added detail to the navdata.db3 it does not make any changes to the mylog.db3

Edit the cells in myLog.db3 and there is not update into navdata.db3

Or am I missing something

Steve

tarbat

  • ShipTrax Beta Testers
  • Hero Member
  • *
  • Posts: 4219
    • Radarbox at Easter Ross
Re: which Database do we do changes in
« Reply #2 on: March 12, 2008, 07:53:02 PM »
There is no automated connection between any of the tables in either database.

That also means you should be careful to maintain referential integrity between tables whenever making changes.  Such as NOT adding a flight for an aircraft that doesn't exist, or adding a flight for a session that doesn't exist, etc.   Or even deleting an aircraft where flights exist for that aircraft.  Without knowing how Radarbox copes with such failures of referential integrity, it's a very dangerous business.

Airnav have not implemented any database triggers to deal with any referential integrity issues that may arise from end-users making updates outside of Radarbox.

By contrast, the Basestation database (SBS1) has triggers in the database to deal with deletions, such as:
CREATE TRIGGER AircraftIDdeltrig
  BEFORE DELETE
  ON Aircraft
BEGIN DELETE FROM Flights WHERE AircraftID = OLD.AircraftID;END;
« Last Edit: March 12, 2008, 07:56:20 PM by tarbat »

steveb25

  • Guest
Re: which Database do we do changes in
« Reply #3 on: March 13, 2008, 11:55:49 AM »
Thanks for that tarbat

I had pretty much come to the same conclsuion myself, but just sought confirmation.

Maybe it is something airnav might look at in further updates to the software.

Once again many thanks for your time

Steve