- Node
- Sequelize
- PostgresSQL
- Any CSVs obtained from the Jersey City Data Portal should have their columns changed to a snake_case format:
[
"event_number",
"district",
"time_received",
"shift",
"time_dispatched",
"time_arrived",
"callcode",
"call_code_description",
"call_type",
"priority",
"unit_id",
"is_primary",
"address",
"city",
"latitude",
"longitude",
"geo_count",
"geo_error"
]
In the config
directory, place a file named db.json
. Example:
{
"host": "localhost",
"dialect": "postgres",
"database": "postgres",
"port": 5432,
"user": "postgres",
"password": "<password>"
}
This will enable the main file to provide the DBWriter class with configuration
In the config
directory, place a file named reader.json
. Example:
{
"csvPath": "./migrator/data/jcpd_calls.csv",
"fileEncoding": "utf8",
"chunkSize": 100,
"logLevel": "debug"
}
csvPath
should point to the location of the exported CSV file.
chunkSize
indicates how many records are to be retrieved at a time. At the end of the file it just returns what is left.
To start it up, run node index.js
in the migrator
directory.