-
Notifications
You must be signed in to change notification settings - Fork 399
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
SQL updates for the planes
table
#1211
Conversation
This updates `create.sql` with the schema changes that were brought in through `clean-duplicate-planes.sql` in jpatokal@36b3ee9. Additionally, this updates `load-data.sql` to seed the DB with the data present in `data/planes.dat`. Resolves jpatokal#1210.
@jpatokal If you ever get a moment, perhaps you could share a schema dump (I'm not a MySQL expert but I think I remember @reedy updated |
I just noticed that #1148 did not include the |
Not particularly. Probably mostly because it wasn't throwing an error... I'd be curious if it's even used, as it seems to be (maybe) updated uses a script that pulls it in from VRS - https://github.com/jpatokal/openflights/blob/2f86a25d09c0721a2b37aa464bd7c474244fdeab/tools/import-vrs.py |
Though as per #1148 "create.sql: Integrate *-upgrade.sql", not "update to match live schema"... https://github.com/jpatokal/openflights/blob/4ff8baf/sql/airlines-upgrade.sql doesn't have a |
Fair enough. The https://github.com/jpatokal/openflights/blob/master/sql/clean-duplicate-airlines.sql#L28
I don't know if they're kept up to date but they are read by the code and produce SQL errors when not present:
|
import wasn't broken (at least, not with an SQL error related to this) on my dev wiki, even without (presumably) having the |
This code only runs when the import is trying to match names based on strings. I don't know if you saw #1197 (comment) but I'm guessing you were using an import file with ID columns populated by the export/backup. Here's an example SQL warning:
|
Anything running the "newer" code would indeed have the column populated. I don't know from what version of openflights I would've originally exported the backup from. But TLDR is that I was using my "live" data from openflights.org, into my dev install. Makes it easy to compare changes... I probably need to wipe the entire database anyway |
@chrisrosset The frequency column is not used by the live website, IIRC it was there to try to sort out duplicates. Here's what the table looks like on the live system:
|
sql/create.sql
Outdated
PRIMARY KEY (`plid`) | ||
`iata` text default NULL, | ||
`icao` text default NULL, | ||
`frequency` int default 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this should be int(11)
to match the live schema
sql/create.sql
Outdated
@@ -155,12 +157,16 @@ CREATE TABLE `locales` ( | |||
|
|||
DROP TABLE IF EXISTS `planes`; | |||
CREATE TABLE `planes` ( | |||
`name` text, | |||
`name` varchar(80), | |||
`abbr` text, | |||
`speed` double default NULL, | |||
`plid` int(11) NOT NULL auto_increment, | |||
`public` char(1) default NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default 'n'
?
@jpatokal, many thanks for posting the schema.
The columns are used! I've even already posted the links to where they're used above. :) I'll list them in more detail now:
Based on them being used, I think we should include them in It'd be nice to get a |
I'd be curious if any indexes are out of line too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a little bit of change in the "functionality" of create.sql now... Not that I'm against it.
But I think
Line 4 in 52e054d
Create empty OpenFlights database schema |
Lines 48 to 50 in 52e054d
<p>Once you have these set up, the <tt>sql/create.sql</tt> script can be used to generate the OpenFlights | |
database schema and the <tt>sql/load_data.sql</tt> script can be used to load in the standard | |
airport, airline and route databases:</p> |
I think the widget stuff is all dead code. I opened #1224 to ask @jpatokal about removing it. |
This updates
create.sql
with the schema changes that were brought in throughclean-duplicate-planes.sql
in 36b3ee9.Additionally, this updates
load-data.sql
to seed the DB with the data present indata/planes.dat
.Resolves #1210.