FAI-CIVL / FAI-Airscore

AirScore - online paragliding / hanggliding GAP-based scoring software.
https://airscore.cc/
GNU General Public License v3.0
13 stars 17 forks source link

sql file - create table before view #217

Closed kuaka closed 3 years ago

kuaka commented 3 years ago

from @biuti:

I also saw that in Airscore.sql we create tables to delete and replace them with views. Is there a reason for that or could we simplify the procedure?

kuaka commented 3 years ago

the sql script is automatically exported from phpmyadmin. So your question would be for mySQL or possibly phpmyadmin teams. However I would suggest that it creates a table as a placeholder so it can build the schema then creates the view. If it were to create the view first it would probably need all the input tables and views created first so order of creation would be important and that is probably a lot of logic that it needs to work out what to create 1st. Just my idea.

biuti commented 3 years ago

I asked because I saw that it deletes them (obviously) before creating views, I suppose it is not needed as far as views are created after all tables, but this is by default I guess. I will try to find something to read about it.

kuaka commented 3 years ago

yes it drops them but only before creating the view. It does not drop all at once. So when a view is created everything else that it may use exists (either in table form or view form). I'm curious as to why you are interested in this. It is a script run once (for a second or so) at airScore installation. It is also a script that is planned to be deprecated when views are removed and alembic is used for DB migration. Given all the issues with airScore at the moment what is to gain by changing this?

biuti commented 3 years ago

Nothing, just curiosity.