Skip to content

Commit 815b891

Browse files
committed
Update importer script for new data model
- Save stop details in the stop_place - quay model - Use requirements.txt to define libraries - Update README
1 parent 408829d commit 815b891

File tree

4 files changed

+262
-234
lines changed

4 files changed

+262
-234
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@ digiroad_stops*.csv
4545

4646
#possible jore3 backup file
4747
jore3dump/*
48-
!jore3dump/put-bak-file-here.txt
48+
!jore3dump/put-bak-file-here.txt
49+
50+
#stop place import script environment file
51+
.env

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -531,3 +531,33 @@ If a test case fails because the `com.microsoft.sqlserver.jdbc.SQLServerExceptio
531531
the error message says that it cannot find a database object, the problem is that the script which
532532
creates the source MSSQL database (_docker/mssql_init/populate.sql_) was changed. You can solve this problem by running the command:
533533
`./development.sh recreate` at command prompt.
534+
535+
---
536+
537+
## Jore3 stop import script
538+
539+
### How to use
540+
541+
By default the script runs from the local jore3 test database and uses the base local Jore4 Hasura instance as the target.
542+
You can change the source database and target Hasura instance by creating a `.env` file in the same directory as the script.
543+
544+
Set the values for variables you want to set:
545+
546+
```
547+
GRAPHQL_URL=
548+
GRAPHQL_SECRET=
549+
JORE3_USERNAME=
550+
JORE3_PASSWORD=
551+
JORE3_DATABASE_URL=
552+
JORE3_DATABASE_NAME=
553+
```
554+
555+
### Requirements
556+
557+
You need to run the `import.py` script using Python 3 and it requires the following libraries:
558+
559+
- pymssql
560+
- requests
561+
- simplejson
562+
563+
They can be installed by running `pip install -r requirements.txt`

0 commit comments

Comments
 (0)