This project uses the aviation data provided by the aviation-json project.
It will create a database (using versioned migrations) and keep it up to date with the JSON files provided by aviation-json by running a single command
A PostgreSQL database named 'aviation' will be created and it will be rebuilt with the latest aviation information.
Keep in mind that the migrations will drop the tables and will re-generate them on every sync. This strategy is only temporally until we complete the aviation frontend app that this data backs up. Once we release v.1 of this module the migrations will not destroy existing tables. They will migrate :)
To start run the command
The configuration is at the
The Makefile gets the username and database from this location.
Initially the user created for the db has no password, if you wish to set a password, you need to do it manually, you need to establish the password at the
database.json file and once you've created the db and the user, set the password with the following command:
psql -U aviator -d aviation -c '\\password'
Add the password to your config file:
if you set the password on the config file before creating the user and the db, the Make workflow will fail.
Main Make commands:
makewill perform the following operations:
- npm install
- check for db, if doesn't exist, it will create it as well as the superuser
- NOTE: creating a sql superuser will request your admin password
- apply a patch to comment a warning on db-migrate.
[WARN] The function "insert" is deprecated.
- perform the first up migration.
- Performs the up migrations.
- Performs the down migrations.
- drops the database.
- drops the user.
Inside the aviation db creates the following tables:
|Abu_Musa_Airport||25°52′32″N||055°01′58″E||Abu Musa Airport||Abumusa Airport||AEU||OIBA|
todo: add cities.
|Amsterdam (wiki path)|
- airport_cities (1:1)
- city_airports (1:m)