location parking table structure#
This table lists the corresponding parking facility for each location (when available) and the distance to it
| Field | Type | NULL allowed | Default Value | Foreign key | Description | 
|---|---|---|---|---|---|
| location | INTEGER | NO | location(location) | Foreign key reference to the location this entry refers to | |
| parking | INTEGER | NO | parking(parking) | Foreign key reference to the parking facility this entry refers to | |
| distance | REAL | YES | The straight line distance (in meters) between this pair of parking and location | ||
| id | INTEGER | YES | The unique identifier of this entry | 
(* - Primary key)
The SQL statement for table and index creation is below.
create TABLE IF NOT EXISTS Location_Parking(
    location INTEGER NOT NULL,
    parking  INTEGER NOT NULL,
    distance REAL,
    id       INTEGER,
    CONSTRAINT "location_fk" FOREIGN KEY("location") REFERENCES "location"("location") DEFERRABLE INITIALLY DEFERRED,
    CONSTRAINT "parking_fk" FOREIGN KEY("parking") REFERENCES "parking"("parking") DEFERRABLE INITIALLY DEFERRED
);
create INDEX IF NOT EXISTS "idx_polaris_loc_parking" ON "Location_Parking" ("location");