Main Menu

NavData

Started by RodBearden, July 04, 2009, 02:06:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RodBearden

Chris recently suggested that the IATA code be made the primary key in the Airlines table, and I think it would be a good idea, but does it actually matter? It does seem to tolerate duplicate ICAO codes anyway.

Also, will this change be possible without having to replace our current NavData files?

Another thing - nobody gave me an answer on the main forum about what the BY condition does. If nobody uses it, can't we get rid of it, or at least make IN the default, and avoid a couple of clicks for every database query that we do?

Rod
Rod

tarbat

If the only thing the Airlines table is used for is to do lookups to derive airline logos, then I'd recommend we change the primary key to C2 (the IATA code).

Change should be possible in the installer, or at first-run of the new v3 app.  Using SQL like this:

CREATE TEMPORARY TABLE airlines01(
  CN,
  C3,
  CM,
  C2
);

INSERT INTO airlines01
SELECT
  CN,
  C3,
  CM,
  C2
FROM airlines;

DROP TABLE airlines;

CREATE TABLE airlines (
  CN  varchar(80),
  C3  varchar(6),
  CM  varchar(6),
  C2  varchar(6) PRIMARY KEY NOT NULL UNIQUE
);

CREATE INDEX iC2
  ON airlines
  (C2);

CREATE INDEX iC3
  ON airlines
  (C3);

INSERT INTO airlines
SELECT
  CN,
  C3,
  CM,
  C2
FROM airlines01;

DROP TABLE airlines01;

AirNav Development

Copied. Pls post more suggestions.
Contact Customer/Technical support via:
http://www.airnavsystems.com/contact.html
[email protected]