Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add index #8

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/app/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ pub fn create_tables(app_state: web::Data<AppState>) -> Result<(), Box<dyn Error
wikipedia_link TEXT,
keywords TEXT
);
CREATE INDEX idx_airports_name ON airports (name);
CREATE INDEX idx_airports_municipality ON airports (municipality);
CREATE INDEX idx_airports_iata_code ON airports (iata_code);
CREATE INDEX idx_airports_iso_country ON airports (iso_country);
CREATE INDEX idx_airports_type ON airports (type);
CREATE TABLE IF NOT EXISTS airport_frequencies (
id INTEGER UNIQUE PRIMARY KEY NOT NULL,
airport_ref INTEGER,
Expand Down Expand Up @@ -93,6 +98,11 @@ pub fn create_tables(app_state: web::Data<AppState>) -> Result<(), Box<dyn Error
power TEXT,
associated_airport TEXT
);
CREATE INDEX idx_navaids_name ON navaids (name);
CREATE INDEX idx_navaids_filename ON navaids (filename);
CREATE INDEX idx_navaids_associated_airport ON navaids (associated_airport);
CREATE INDEX idx_navaids_type ON navaids (type);
CREATE INDEX idx_navaids_iso_country ON navaids (iso_country);
";
app_state
.sqlite_connection
Expand Down